1 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
5 " Ordinary ctrl+{c,x,v} using system clipboard register +. We use autocmd to
6 " override plugin keymaps.
7 autocmd VimEnter * vnoremap <C-c> "+y
8 autocmd VimEnter * vnoremap <C-x> "+x
9 autocmd VimEnter * nnoremap <C-v> "+p
10 autocmd VimEnter * inoremap <C-v> <c-r>+
13 nnoremap <C-p> :Denite file/rec<cr>
14 nnoremap <space>/ :Denite grep:.<cr>
15 nnoremap <space>s :Denite buffer<cr>
17 nnoremap <C-space> pumvisible() ? "\<c-n>" : "\<tab>"
19 nnoremap <F2> :NERDTreeToggle<cr>
20 nnoremap <F3> :TagbarToggle<cr>
22 nmap <s-PageDown> :bn<CR>
23 nmap <s-PageUp> :bp<CR>
25 map <a-c> <plug>NERDCommenterToggle
27 imap <C-k> <Plug>(neosnippet_expand_or_jump)
28 smap <C-k> <Plug>(neosnippet_expand_or_jump)
29 xmap <C-k> <Plug>(neosnippet_expand_target)
31 " Start interactive EasyAlign in visual mode (e.g. vipga)
32 vmap <Enter> <Plug>(EasyAlign)
33 " Start interactive EasyAlign for a motion/text object (e.g. gaip)
34 nmap ga <Plug>(EasyAlign)
37 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
38 " Some filetype-specific settings
40 au Filetype gnuplot map <buffer> <F5> :call OpenIn("gnuplot -persist") <CR>
42 " Performs a vertial split and a FSHere. For a header file the split is
43 " performed to the left, for an implementation file to the right.
45 " We split to the right on header files
46 if match(expand('%:e'), 'h.*') >= 0
47 execute ':leftabove vsplit'
49 execute ':rightbelow vsplit'
55 au Filetype c,cpp,objc map <buffer> <F11> :call FSvsplit()<CR>
56 " Terminal-based vi report S-F11 as F23
57 au Filetype c,cpp,objc map <buffer> <S-F11> :FSHere<CR>
58 au Filetype c,cpp,objc map <buffer> <F23> :FSHere<CR>
60 au Filetype markdown map <buffer> <F5> :call RunMarkdown()<CR>
61 au Filetype asciidoc map <buffer> <F5> :call RunAsciidoc()<CR>
63 " See https://github.com/artur-shaik/vim-Javacomplete2
65 au FileType java nmap <F4> <Plug>(JavaComplete-Imports-AddSmart)
66 au FileType java imap <F4> <Plug>(JavaComplete-Imports-AddSmart)
68 au FileType java nmap <F5> <Plug>(JavaComplete-Imports-Add)
69 au FileType java imap <F5> <Plug>(JavaComplete-Imports-Add)
71 au FileType java nmap <F6> <Plug>(JavaComplete-Imports-AddMissing)
72 au FileType java imap <F6> <Plug>(JavaComplete-Imports-AddMissing)
74 au FileType java nmap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
75 au FileType java imap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
78 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
79 " Some plugin-specific settings
83 if filereadable($HOME . '/.vim/keymaps-local.vim')
84 source ~/.vim/keymaps-local.vim