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 " ctrl+d as EOF exits shells and the like. Add a keymap for the same here.
16 nnoremap <C-p> :Denite file/rec<cr>
17 nnoremap <space>/ :Denite grep:.<cr>
18 nnoremap <space>s :Denite buffer<cr>
20 nnoremap <C-space> pumvisible() ? "\<c-n>" : "\<tab>"
22 nnoremap <F2> :NERDTreeToggle<cr>
23 nnoremap <F3> :TagbarToggle<cr>
25 nmap <s-PageDown> :bn<CR>
26 nmap <s-PageUp> :bp<CR>
28 map <a-c> <plug>NERDCommenterToggle
30 imap <C-k> <Plug>(neosnippet_expand_or_jump)
31 smap <C-k> <Plug>(neosnippet_expand_or_jump)
32 xmap <C-k> <Plug>(neosnippet_expand_target)
34 " Start interactive EasyAlign in visual mode (e.g. vipga)
35 vmap <Enter> <Plug>(EasyAlign)
36 " Start interactive EasyAlign for a motion/text object (e.g. gaip)
37 nmap ga <Plug>(EasyAlign)
40 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
41 " Some filetype-specific settings
43 au Filetype gnuplot map <buffer> <F5> :call OpenIn("gnuplot -persist") <CR>
45 " Performs a vertial split and a FSHere. For a header file the split is
46 " performed to the left, for an implementation file to the right.
48 " We split to the right on header files
49 if match(expand('%:e'), 'h.*') >= 0
50 execute ':leftabove vsplit'
52 execute ':rightbelow vsplit'
58 au Filetype c,cpp,objc map <buffer> <F11> :call FSvsplit()<CR>
59 " Terminal-based vi report S-F11 as F23
60 au Filetype c,cpp,objc map <buffer> <S-F11> :FSHere<CR>
61 au Filetype c,cpp,objc map <buffer> <F23> :FSHere<CR>
63 au Filetype markdown map <buffer> <F5> :call RunMarkdown()<CR>
64 au Filetype asciidoc map <buffer> <F5> :call RunAsciidoc()<CR>
66 " See https://github.com/artur-shaik/vim-Javacomplete2
68 au FileType java nmap <F4> <Plug>(JavaComplete-Imports-AddSmart)
69 au FileType java imap <F4> <Plug>(JavaComplete-Imports-AddSmart)
71 au FileType java nmap <F5> <Plug>(JavaComplete-Imports-Add)
72 au FileType java imap <F5> <Plug>(JavaComplete-Imports-Add)
74 au FileType java nmap <F6> <Plug>(JavaComplete-Imports-AddMissing)
75 au FileType java imap <F6> <Plug>(JavaComplete-Imports-AddMissing)
77 au FileType java nmap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
78 au FileType java imap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
81 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
82 " Some plugin-specific settings
86 if filereadable($HOME . '/.vim/keymaps-local.vim')
87 source ~/.vim/keymaps-local.vim