X-Git-Url: https://git.sthu.org/?p=vimconf.git;a=blobdiff_plain;f=keymaps.vim;h=883b3e00eac93e837ba1a748edc13dc61c7fdee3;hp=d4a5f979053141fac75d19d750e33da517595744;hb=HEAD;hpb=f8b34fbb5f65efffa11b3ee5018c5c924b2a95b5 diff --git a/keymaps.vim b/keymaps.vim index d4a5f97..38f7774 100644 --- a/keymaps.vim +++ b/keymaps.vim @@ -1,6 +1,30 @@ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " 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 + " 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 + nnoremap pumvisible() ? "\" : "\" nnoremap :NERDTreeToggle @@ -26,11 +50,26 @@ nmap ga (EasyAlign) au Filetype gnuplot map :call OpenIn("gnuplot -persist") -au Filetype c,cpp,objc map :vsplit:FSRight -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() +au Filetype asciidoc,asciidoctor map :call RunAsciidoc() " See https://github.com/artur-shaik/vim-Javacomplete2 " ji ji @@ -52,7 +91,6 @@ au FileType java imap (JavaComplete-Imports-RemoveUnused) - if filereadable($HOME . '/.vim/keymaps-local.vim') source ~/.vim/keymaps-local.vim endif