X-Git-Url: https://git.sthu.org/?p=vimconf.git;a=blobdiff_plain;f=keymaps.vim;h=bc6f51d547110ee3010ff132ad78b7bc56ef0887;hp=b56d8db08b9b668292471420588cca4e293589ee;hb=07c883a5418028bbb48b38d6a2cf86d011de4b1b;hpb=90f6febcf28faac867fb73a03fced39c947074e6 diff --git a/keymaps.vim b/keymaps.vim index b56d8db..bc6f51d 100644 --- a/keymaps.vim +++ b/keymaps.vim @@ -39,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()