-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
513 lines (456 loc) · 19.7 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
"
" Author: Julia Jacobs
" repo : https://github.com/jewelsjacobs/dotfiles/
"
" Setup NeoBundle ----------------------------------------------------------{{{
" If vundle is not installed, do it first
if (!isdirectory(expand("$HOME/.vim/repos/github.com/Shougo/dein.vim")))
call system(expand("mkdir -p $HOME/.vim/repos/github.com"))
call system(expand("git clone https://github.com/Shougo/dein.vim $HOME/.vim/repos/github.com/Shougo/dein.vim"))
endif
set nocompatible
" Required:
set runtimepath+=~/.vim/repos/github.com/Shougo/dein.vim/
" set runtimepath+=~/Github/deoplete-angular/
" Required:
call dein#begin(expand('~/.vim'))
let pluginsExist = 0
" Let NeoBundle manage NeoBundle
" Required:
call dein#add('Shougo/dein.vim')
" syntax
call dein#add('othree/yajs.vim', {'on_ft': 'javascript'})
call dein#add('othree/jsdoc-syntax.vim', {'on_ft':['javascript', 'typescript']})
call dein#add('othree/es.next.syntax.vim', {'on_ft': 'javascript'})
call dein#add('1995eaton/vim-better-javascript-completion', {'on_ft': ['javascript']})
call dein#add('othree/javascript-libraries-syntax.vim')
call dein#add('kchmck/vim-coffee-script', {'on_ft': 'coffee'})
call dein#add('hail2u/vim-css3-syntax', {'on_ft':['css','scss']})
call dein#add('elzr/vim-json', {'on_ft': 'json'})
call dein#add('tpope/vim-markdown', {'on_ft': 'markdown'})
call dein#add('dhruvasagar/vim-table-mode')
call dein#add('suan/vim-instant-markdown', {'on_ft': 'markdown'})
call dein#add('tmhedberg/SimpylFold', {'on_ft': 'python'})
call dein#add('HerringtonDarkholme/yats.vim', {'on_ft': 'typescript'})
call dein#add('Quramy/tsuquyomi', {'on_ft': 'typescript'})
call dein#add('mhartington/oceanic-next')
call dein#add('Yggdroot/indentLine')
call dein#add('Raimondi/delimitMate', {'on_ft': ['javascript', 'typescript', 'css', 'scss']})
call dein#add('valloric/MatchTagAlways', {'on_ft': 'html'})
call dein#add('tpope/vim-fugitive')
call dein#add('jreybert/vimagit')
call dein#add('mhinz/vim-signify')
call dein#add('Xuyuanp/nerdtree-git-plugin')
call dein#add('https://github.com/jaxbot/github-issues.vim')
call dein#add('tpope/vim-repeat')
call dein#add('benekastah/neomake')
call dein#add('editorconfig/editorconfig-vim')
call dein#add('scrooloose/nerdtree')
call dein#add('AndrewRadev/switch.vim')
call dein#add('christoomey/vim-tmux-navigator')
call dein#add('tmux-plugins/vim-tmux')
call dein#add('tmux-plugins/vim-tmux-focus-events')
call dein#add('vim-airline/vim-airline')
call dein#add('tpope/vim-surround')
call dein#add('tomtom/tcomment_vim')
call dein#add('mattn/emmet-vim', {'on_ft': 'html'})
call dein#add('Chiel92/vim-autoformat')
call dein#add('ap/vim-css-color')
call dein#add('Shougo/unite.vim')
call dein#add('Shougo/unite-outline')
call dein#add('ujihisa/unite-colorscheme')
call dein#add('junkblocker/unite-codesearch')
call dein#add('Shougo/vimproc.vim', {'build' : 'make'})
call dein#add('Shougo/neocomplete.vim')
call dein#add('Shougo/neco-vim', {'on_ft': 'vim'})
call dein#add('Shougo/neoinclude.vim')
call dein#add('ujihisa/neco-look')
call dein#add('zchee/deoplete-jedi')
call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')
call dein#add('honza/vim-snippets')
call dein#add('matthewsimo/angular-vim-snippets')
call dein#add('mhinz/vim-sayonara')
call dein#add('mattn/webapi-vim')
call dein#add('mattn/gist-vim')
call dein#add('terryma/vim-multiple-cursors')
call dein#add('rhysd/github-complete.vim')
call dein#add('junegunn/goyo.vim')
call dein#add('vim-scripts/SyntaxRange')
call dein#add('zchee/deoplete-go', {'build': 'make'},{'on_ft': 'go'})
call dein#add('rhysd/nyaovim-popup-tooltip')
call dein#add('ryanoasis/vim-devicons')
if dein#check_install()
call dein#install()
endif
call dein#end()
" Required:
filetype plugin indent on
" }}}
" System Settings ----------------------------------------------------------{{{
" Let airline tell me my status
set noshowmode
set noswapfile
filetype on
set relativenumber number
set tabstop=2 shiftwidth=2 expandtab
set conceallevel=0
" block select not limited by shortest line
set virtualedit=
set wildmenu
set laststatus=2
"set colorcolumn=100
set wrap linebreak nolist
set wildmode=full
" leader is ,
let mapleader = ','
set undofile
set undodir="$HOME/.VIM_UNDO_FILES"
" Remember cursor position between vim sessions
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
" center buffer around cursor when opening files
autocmd BufRead * normal zz
let g:jsx_ext_required = 0
set complete=.,w,b,u,t,k
let g:gitgutter_max_signs = 1000 " default value
autocmd InsertEnter * let save_cwd = getcwd() | set autochdir
autocmd InsertLeave * set noautochdir | execute 'cd' fnameescape(save_cwd)
let g:indentLine_char='│'
" enable deoplete
let g:neocomplete#enable_at_startup = 1
let g:unite_source_codesearch_command = '$HOME/bin/csearch'
let g:table_mode_corner="|"
" }}}
" System mappings ----------------------------------------------------------{{{
" No need for ex mode
nnoremap Q <nop>
" recording macros is not my thing
map q <Nop>
" exit insert, dd line, enter insert
inoremap <c-d> <esc>ddi
" Navigate between display lines
noremap <silent> <Up> gk
noremap <silent> <Down> gj
noremap <silent> k gk
noremap <silent> j gj
noremap <silent> <Home> g<Home>
noremap <silent> <End> g<End>
inoremap <silent> <Home> <C-o>g<Home>
inoremap <silent> <End> <C-o>g<End>
" copy current files path to clipboard
nmap cp :let @+ = expand("%") <cr>
" ,f to format code, requires formatters: read the docs
noremap <leader>f :Autoformat<CR>
noremap <leader>TM :TableModeToggle<CR>
" exit insert, dd line, enter insert
inoremap <c-d> <esc>ddi
noremap H ^
noremap L g_
noremap J 5j
noremap K 5k
" this is the best, let me tell you why
" how annoying is that everytime you want to do something in vim
" you have to do shift-; to get :, can't we just do ;?
" Plus what does ; do anyways??
" if you do have a plugin that needs ;, you can just wap the mapping
" nnoremap : ;
" give it a try and you will like it
nnoremap ; :
inoremap <c-f> <c-x><c-f>
" Copy to osx clipboard
vnoremap <C-c> "*y<CR>
vnoremap y "*y<CR>
nnoremap Y "*Y<CR>
let g:multi_cursor_next_key='<C-n>'
let g:multi_cursor_prev_key='<C-p>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'
" Align blocks of text and keep them selected
vmap < <gv
vmap > >gv
nnoremap <leader>d "_d
vnoremap <leader>d "_d
vnoremap <c-/> :TComment<cr>
" map <esc> :noh<cr>
autocmd FileType typescript nmap <buffer> <Leader>T : <C-u>echo tsuquyomi#hint()<CR>
nnoremap <leader>e :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
function! s:PlaceholderImgTag(size)
let url = 'http://dummyimage.com/' . a:size . '/000000/555555'
let [width,height] = split(a:size, 'x')
execute "normal a<img src=\"".url."\" width=\"".width."\" height=\"".height."\" />"
endfunction
command! -nargs=1 PlaceholderImgTag call s:PlaceholderImgTag(<f-args>)
"}}}
" Themes, Commands, etc ----------------------------------------------------{{{
" Theme
syntax enable
colorscheme OceanicNext
set background=dark
" set background=light
" no need to fold things in markdown all the time
let g:vim_markdown_folding_disabled = 1
" turn on spelling for markdown files
autocmd BufRead,BufNewFile *.md setlocal spell complete+=kspell
" highlight bad words in red
autocmd BufRead,BufNewFile *.md hi SpellBad guibg=#ff2929 guifg=#ffffff" ctermbg=224
" disable markdown auto-preview. Gets annoying
let g:instant_markdown_autostart = 0
"}}}
" Fold, gets it's own section ----------------------------------------------{{{
function! MyFoldText() " {{{
let line = getline(v:foldstart)
let nucolwidth = &fdc + &number * &numberwidth
let windowwidth = winwidth(0) - nucolwidth - 3
let foldedlinecount = v:foldend - v:foldstart
" expand tabs into spaces
let onetab = strpart(' ', 0, &tabstop)
let line = substitute(line, '\t', onetab, 'g')
let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' '
endfunction " }}}
function! JavaScriptFold() "{{{
" syntax region foldBraces start=/{/ end=/}/ transparent fold keepend extend
setlocal foldmethod=syntax
setlocal foldlevel=99
echo "hello"
syn region foldBraces start=/{/ skip=/\(\/\/.*\)\|\(\/.*\/\)/ end=/}/ transparent fold keepend extend
endfunction "}}}
" function! HTMLFold() "{{{
" " syn sync fromstart
" set foldmethod=syntax
" syn region HTMLFold start=+^<\([^/?!><]*[^/]>\)\&.*\(<\1\|[[:alnum:]]\)$+ end=+^</.*[^-?]>$+ fold transparent keepend extend
" syn match HTMLCData "<!\[CDATA\[\_.\{-}\]\]>" fold transparent extend
" syn match HTMLCommentFold "<!--\_.\{-}-->" fold transparent extend
" endfunction "}}}
set foldtext=MyFoldText()
autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif
autocmd FileType vim setlocal fdc=1
set foldlevel=99
" Space to toggle folds.
nnoremap <Space> za
vnoremap <Space> za
autocmd FileType vim setlocal foldmethod=marker
autocmd FileType vim setlocal foldlevel=0
" au FileType html call HTMLFold()
" autocmd FileType html setlocal foldmethod=syntax
autocmd FileType html setlocal fdl=99
" autocmd FileType javascript call JavaScriptFold()
autocmd FileType javascript,html,css,scss,typescript setlocal foldlevel=99
autocmd FileType javascript,typescript,css,scss,json setlocal foldmethod=marker
autocmd FileType javascript,typescript,css,scss,json setlocal foldmarker={,}
autocmd FileType coffee setl foldmethod=indent
" au FileType html nnoremap <buffer> <leader>F zfat
" }}}
" NERDTree ------------------------------------------------------------------{{{
map <C-\> :NERDTreeToggle<CR>
autocmd StdinReadPre * let s:std_in=1
" autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
let NERDTreeShowHidden=1
let g:NERDTreeWinSize=45
let g:NERDTreeAutoDeleteBuffer=1
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd FileType nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd FileType nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
" call NERDTreeHighlightFile('jade', 'green', 'none', 'green', 'none')
" call NERDTreeHighlightFile('md', 'blue', 'none', '#6699CC', 'none')
" call NERDTreeHighlightFile('config', 'yellow', 'none', '#d8a235', 'none')
" call NERDTreeHighlightFile('conf', 'yellow', 'none', '#d8a235', 'none')
" call NERDTreeHighlightFile('json', 'green', 'none', '#d8a235', 'none')
" call NERDTreeHighlightFile('html', 'yellow', 'none', '#d8a235', 'none')
" call NERDTreeHighlightFile('css', 'cyan', 'none', '#5486C0', 'none')
" call NERDTreeHighlightFile('scss', 'cyan', 'none', '#5486C0', 'none')
" call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', 'none')
" call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', 'none')
" call NERDTreeHighlightFile('ts', 'Blue', 'none', '#6699cc', 'none')
" call NERDTreeHighlightFile('ds_store', 'Gray', 'none', '#686868', 'none')
" call NERDTreeHighlightFile('gitconfig', 'black', 'none', '#686868', 'none')
" call NERDTreeHighlightFile('gitignore', 'Gray', 'none', '#7F7F7F', 'none')
call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#141e23')
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#141e23')
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#141e23')
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#141e23')
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#141e23')
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#141e23')
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#141e23')
call NERDTreeHighlightFile('ts', 'Blue', 'none', '#6699cc', '#141e23')
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#141e23')
call NERDTreeHighlightFile('ds_store', 'Gray', 'none', '#686868', '#141e23')
call NERDTreeHighlightFile('gitconfig', 'Gray', 'none', '#686868', '#141e23')
call NERDTreeHighlightFile('gitignore', 'Gray', 'none', '#686868', '#141e23')
call NERDTreeHighlightFile('bashrc', 'Gray', 'none', '#686868', '#141e23')
call NERDTreeHighlightFile('bashprofile', 'Gray', 'none', '#686868', '#141e23')
"}}}
" Snipppets -----------------------------------------------------------------{{{
" Enable snipMate compatibility feature.
let g:neosnippet#enable_snipmate_compatibility = 1
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" Tell Neosnippet about the other snippets
let g:neosnippet#snippets_directory='~/.vim/bundle/neosnippet-snippets/neosnippets, ~/Github/ionic-snippets, ~/.vim/bundle/angular-vim-snippets/snippets'
" SuperTab like snippets behavior.
imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: pumvisible() ? "\<C-n>" : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: "\<TAB>"
"}}}
" Typescript & Javscript omni complete --------------------------------------{{{
let g:vimjs#casesensistive = 1
let g:vimjs#smartcomplete = 1
let g:tsuquyomi_disable_quickfix = 1
let g:vim_json_syntax_conceal = 0
autocmd FileType setlocal completeopt+=noselect,menu,preview
set completeopt+=noselect,menu,preview
" if !exists('g:neocomplete#force_omni_input_patterns')
" let g:neocomplete#force_omni_input_patterns = {}
" endif
" let g:neocomplete#force_omni_input_patterns.typescript = '[^. *\t]\.\w*\|\h\w*::'
"}}}
" Emmet customization -------------------------------------------------------{{{
" Enable Emmet in all modes
" Remapping <C-y>, just doesn't cut it.
function! s:expand_html_tab()
" try to determine if we're within quotes or tags.
" if so, assume we're in an emmet fill area.
let line = getline('.')
if col('.') < len(line)
let line = matchstr(line, '[">][^<"]*\%'.col('.').'c[^>"]*[<"]')
if len(line) >= 2
return "\<C-n>"
endif
endif
" expand anything emmet thinks is expandable.
if emmet#isExpandable()
return "\<C-y>,"
endif
" return a regular tab character
return "\<tab>"
endfunction
autocmd FileType html,markdown imap <buffer><expr><tab> <sid>expand_html_tab()
let g:user_emmet_mode='a'
let g:user_emmet_complete_tag = 1
let g:user_emmet_install_global = 0
autocmd FileType html,css EmmetInstall
"}}}
" unite ---------------------------------------------------------------------{{{
"
let g:unite_data_directory='~/.nvim/.cache/unite'
let g:unite_source_history_yank_enable=1
let g:unite_prompt='» '
let g:unite_source_rec_async_command =['ag', '--follow', '--nocolor', '--nogroup','--hidden', '-g', '', '--ignore', '.git', '--ignore', '*.png', '--ignore', 'lib']
nnoremap <silent> <c-p> :Unite -auto-resize -start-insert -direction=botright file_rec/async<CR>
nnoremap <silent> <leader>c :Unite -auto-resize -start-insert -direction=botright colorscheme<CR>
nnoremap <silent> <leader>u :Unite neobundle/update<CR>
" Custom mappings for the unite buffer
autocmd FileType unite call s:unite_settings()
function! s:unite_settings() "{{{
" Enable navigation with control-j and control-k in insert mode
imap <buffer> <C-j> <Plug>(unite_select_next_line)
imap <buffer> <C-k> <Plug>(unite_select_previous_line)
endfunction "}}}
" Git from unite...ERMERGERD ------------------------------------------------{{{
let g:unite_source_menu_menus = {} " Useful when building interfaces at appropriate places
let g:unite_source_menu_menus.git = {
\ 'description' : 'Fugitive interface',
\}
let g:unite_source_menu_menus.git.command_candidates = [
\[' git status', 'Gstatus'],
\[' git diff', 'Gvdiff'],
\[' git commit', 'Gcommit'],
\[' git stage/add', 'Gwrite'],
\[' git checkout', 'Gread'],
\[' git rm', 'Gremove'],
\[' git cd', 'Gcd'],
\[' git push', 'exe "Git! push " input("remote/branch: ")'],
\[' git pull', 'exe "Git! pull " input("remote/branch: ")'],
\[' git pull rebase', 'exe "Git! pull --rebase " input("branch: ")'],
\[' git checkout branch', 'exe "Git! checkout " input("branch: ")'],
\[' git fetch', 'Gfetch'],
\[' git merge', 'Gmerge'],
\[' git browse', 'Gbrowse'],
\[' git head', 'Gedit HEAD^'],
\[' git parent', 'edit %:h'],
\[' git log commit buffers', 'Glog --'],
\[' git log current file', 'Glog -- %'],
\[' git log last n commits', 'exe "Glog -" input("num: ")'],
\[' git log first n commits', 'exe "Glog --reverse -" input("num: ")'],
\[' git log until date', 'exe "Glog --until=" input("day: ")'],
\[' git log grep commits', 'exe "Glog --grep= " input("string: ")'],
\[' git log pickaxe', 'exe "Glog -S" input("string: ")'],
\[' git index', 'exe "Gedit " input("branchname\:filename: ")'],
\[' git mv', 'exe "Gmove " input("destination: ")'],
\[' git grep', 'exe "Ggrep " input("string: ")'],
\[' git prompt', 'exe "Git! " input("command: ")'],
\] " Append ' --' after log to get commit info commit buffers
nnoremap <silent> <Leader>g :Unite -direction=botright -silent -buffer-name=git -start-insert menu:git<CR>
"}}}
"}}}
" Navigate between vim buffers and tmux panels ------------------------------{{{
let g:tmux_navigator_no_mappings = 1
nnoremap <silent> <C-j> :TmuxNavigateDown<cr>
nnoremap <silent> <C-k> :TmuxNavigateUp<cr>
nnoremap <silent> <C-l> :TmuxNavigateRight<cr>
nnoremap <silent> <C-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <C-;> :TmuxNavigatePrevious<cr>
"}}}
" vim-airline ---------------------------------------------------------------{{{
let g:airline#extensions#tabline#enabled = 1
set hidden
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#tabline#show_tab_nr = 1
let g:airline_powerline_fonts = 1
let g:airline_theme='oceanicnext'
" let g:airline_theme='base16_solarized'
cnoreabbrev <expr> x getcmdtype() == ":" && getcmdline() == 'x' ? 'Sayonara' : 'x'
nmap <leader>t :term<cr>
nmap <leader>, :bnext<CR>
nmap <leader>. :bprevious<CR>
let g:airline#extensions#tabline#buffer_idx_mode = 1
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9
set guifont=Sauce\ Code\ Pro\ Nerd\ Font\ Complete:h13
"}}}
" Linting -------------------------------------------------------------------{{{
function! neomake#makers#ft#javascript#eslint()
return {
\ 'args': ['-f', 'compact'],
\ 'errorformat': '%E%f: line %l\, col %c\, Error - %m,' .
\ '%W%f: line %l\, col %c\, Warning - %m'
\ }
endfunction
let g:neomake_javascript_enabled_makers = ['eslint']
autocmd! BufWritePost * Neomake
function! JscsFix()
let l:winview = winsaveview()
% ! jscs -x
call winrestview(l:winview)
endfunction
command JscsFix :call JscsFix()
noremap <leader>j :JscsFix<CR>
"}}}