X-Git-Url: https://git.sthu.org/?p=vimconf.git;a=blobdiff_plain;f=keymaps.vim;h=bc6f51d547110ee3010ff132ad78b7bc56ef0887;hp=9f9f6aa1f6c534dd13bb480e3446eadca8b81ce9;hb=07c883a5418028bbb48b38d6a2cf86d011de4b1b;hpb=0775333fea8cb2c3fe4cd87a43274a2023f724f9 diff --git a/keymaps.vim b/keymaps.vim index 9f9f6aa..bc6f51d 100644 --- a/keymaps.vim +++ b/keymaps.vim @@ -1,6 +1,15 @@ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Global settings +if has('clipboard') + " Ordinary ctrl+{c,x,v} using system clipboard register +. We use autocmd to + " override plugin keymaps. + autocmd VimEnter * vnoremap "+y + autocmd VimEnter * vnoremap "+x + autocmd VimEnter * nnoremap "+p + autocmd VimEnter * inoremap + +endif + nnoremap :Denite file/rec nnoremap / :Denite grep:. nnoremap s :Denite buffer @@ -30,8 +39,23 @@ nmap ga (EasyAlign) au Filetype gnuplot map :call OpenIn("gnuplot -persist") -au Filetype c,cpp,objc map :vsplit:FSRight +" Performs a vertial split and a FSHere. For a header file the split is +" performed to the left, for an implementation file to the right. +function FSvsplit() + " We split to the right on header files + if match(expand('%:e'), 'h.*') >= 0 + execute ':leftabove vsplit' + else + execute ':rightbelow vsplit' + endif + + execute ':FSHere' +endfunction + +au Filetype c,cpp,objc map :call FSvsplit() +" Terminal-based vi report S-F11 as F23 au Filetype c,cpp,objc map :FSHere +au Filetype c,cpp,objc map :FSHere au Filetype markdown map :call RunMarkdown() au Filetype asciidoc map :call RunAsciidoc() @@ -54,8 +78,6 @@ au FileType java imap (JavaComplete-Imports-RemoveUnused) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Some plugin-specific settings -" Add :imap to :map of plugin -imap Unicoder if filereadable($HOME . '/.vim/keymaps-local.vim')