X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=keymaps.vim;h=d9356db44d5cea76b85299f44ff34956c15adff2;hb=a3115572c519b5aea23cfa29690cead4c62b903a;hp=4569a4a5a4e64f1a0766d9171bab696b7ca6850c;hpb=d9aa01a5a8dd9fdd82351b4dea9002d1266a40f9;p=vimconf.git diff --git a/keymaps.vim b/keymaps.vim index 4569a4a..d9356db 100644 --- a/keymaps.vim +++ b/keymaps.vim @@ -6,7 +6,7 @@ if has('clipboard') " override plugin keymaps. autocmd VimEnter * vnoremap "+y autocmd VimEnter * vnoremap "+x - autocmd VimEnter * nnoremap "+p + "autocmd VimEnter * nnoremap "+p autocmd VimEnter * inoremap + endif @@ -39,7 +39,20 @@ 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