X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=keymaps.vim;h=bf0597d1661f1c9ea0dc8d5fea16b0ca5f11915a;hb=1526f4626f30cb24af4bee1ea94656295f423b21;hp=4569a4a5a4e64f1a0766d9171bab696b7ca6850c;hpb=d9aa01a5a8dd9fdd82351b4dea9002d1266a40f9;p=vimconf.git diff --git a/keymaps.vim b/keymaps.vim index 4569a4a..bf0597d 100644 --- a/keymaps.vim +++ b/keymaps.vim @@ -2,14 +2,25 @@ " Global settings if has('clipboard') + " Use + or * registers + if has('unnamedplus') + set clipboard+=unnamedplus + else + set clipboard+=unnamed + endif + " 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 + + "autocmd VimEnter * vnoremap "+y + "autocmd VimEnter * vnoremap "+x + " Is performed by S+Ins + "autocmd VimEnter * nnoremap "+p + "autocmd VimEnter * inoremap + endif +" ctrl+d as EOF exits shells and the like. Add a keymap for the same here. +nnoremap :q + nnoremap :Denite file/rec nnoremap / :Denite grep:. nnoremap s :Denite buffer @@ -39,10 +50,23 @@ nmap ga (EasyAlign) au Filetype gnuplot map :call OpenIn("gnuplot -persist") -au Filetype c,cpp,objc map :vsplit:FSRight -" Terminal-based vi report S-F11 as F23 -au Filetype c,cpp,objc map :FSHere -au Filetype c,cpp,objc map :FSHere +" 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-F12 as F24 +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()