blob: 1ca602c17412d943ec0aaf568f37ee2829d77342 (
plain)
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
|
" ~/.vim/ftplugin/javascript/javascript.vim
" JavaScript-specific vim configuration
"
" Syntastic linters: jslint
" JSLint arguments
let g:syntastic_javascript_jslint_args = "--browser --indent"
" Tabs are expanded to 4 spaces
setlocal tabstop=4 shiftwidth=4 expandtab
" Show existing tabs (they can be deleted with :retab)
setlocal list
" Column marker: 80 characters
call matchadd('ColorColumn', '\%81v', 100)
setlocal textwidth=80
" Mappings
nnoremap <buffer> <leader>C :sp ~/.vim/ftplugin/javascript/javascript.vim<CR>
nnoremap <buffer> <leader>gt :YcmCompleter GoTo<CR>
nnoremap <buffer> <leader>gr :YcmCompleter GoToReferences<CR>
nnoremap <buffer> <leader>fi :YcmCompleter FixIt<CR>
nnoremap <buffer> <leader>r :YcmCompleter RefactorRename<Space>
nnoremap <buffer> <leader>e :YcmDiags<CR>
nnoremap <buffer> <leader>E :Errors<CR>
inoremap <buffer> <leader>if if (<+++>) {<CR><++><CR>} <++><Esc>?<+++><CR>cf>
inoremap <buffer> <leader>else else {<CR><+++><CR>}<CR><++><Esc>?<+++><CR>cf>
|