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 " Is performed by S+Ins
10 "autocmd VimEnter * nnoremap <C-v> "+p
11 "autocmd VimEnter * inoremap <C-v> <c-r>+
14 " ctrl+d as EOF exits shells and the like. Add a keymap for the same here.
17 nnoremap <C-p> :Denite file/rec<cr>
18 nnoremap <space>/ :Denite grep:.<cr>
19 nnoremap <space>s :Denite buffer<cr>
21 nnoremap <C-space> pumvisible() ? "\<c-n>" : "\<tab>"
23 nnoremap <F2> :NERDTreeToggle<cr>
24 nnoremap <F3> :TagbarToggle<cr>
26 nmap <s-PageDown> :bn<CR>
27 nmap <s-PageUp> :bp<CR>
29 map <a-c> <plug>NERDCommenterToggle
31 imap <C-k> <Plug>(neosnippet_expand_or_jump)
32 smap <C-k> <Plug>(neosnippet_expand_or_jump)
33 xmap <C-k> <Plug>(neosnippet_expand_target)
35 " Start interactive EasyAlign in visual mode (e.g. vipga)
36 vmap <Enter> <Plug>(EasyAlign)
37 " Start interactive EasyAlign for a motion/text object (e.g. gaip)
38 nmap ga <Plug>(EasyAlign)
41 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
42 " Some filetype-specific settings
44 au Filetype gnuplot map <buffer> <F5> :call OpenIn("gnuplot -persist") <CR>
46 " Performs a vertial split and a FSHere. For a header file the split is
47 " performed to the left, for an implementation file to the right.
49 " We split to the right on header files
50 if match(expand('%:e'), 'h.*') >= 0
51 execute ':leftabove vsplit'
53 execute ':rightbelow vsplit'
59 au Filetype c,cpp,objc map <buffer> <F12> :call FSvsplit()<CR>
60 " Terminal-based vi report S-F12 as F24
61 au Filetype c,cpp,objc map <buffer> <S-F12> :FSHere<CR>
62 au Filetype c,cpp,objc map <buffer> <F24> :FSHere<CR>
64 au Filetype markdown map <buffer> <F5> :call RunMarkdown()<CR>
65 au Filetype asciidoc map <buffer> <F5> :call RunAsciidoc()<CR>
67 " See https://github.com/artur-shaik/vim-Javacomplete2
69 au FileType java nmap <F4> <Plug>(JavaComplete-Imports-AddSmart)
70 au FileType java imap <F4> <Plug>(JavaComplete-Imports-AddSmart)
72 au FileType java nmap <F5> <Plug>(JavaComplete-Imports-Add)
73 au FileType java imap <F5> <Plug>(JavaComplete-Imports-Add)
75 au FileType java nmap <F6> <Plug>(JavaComplete-Imports-AddMissing)
76 au FileType java imap <F6> <Plug>(JavaComplete-Imports-AddMissing)
78 au FileType java nmap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
79 au FileType java imap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
82 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
83 " Some plugin-specific settings
87 if filereadable($HOME . '/.vim/keymaps-local.vim')
88 source ~/.vim/keymaps-local.vim