plugins: Change easychair2 url
[vimconf.git] / keymaps.vim
index 6f9c335d09b28e7a2c56145f840a6edbd6eb39ee..38f7774ee4d6a38379edc9f0e8f66e243c19337b 100644 (file)
@@ -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 <C-c> "+y
-    autocmd VimEnter * vnoremap <C-x> "+x
-    autocmd VimEnter * nnoremap <C-v> "+p
-    autocmd VimEnter * inoremap <C-v> <c-r>+
+    "autocmd VimEnter * vnoremap <C-c> "+y
+    "autocmd VimEnter * vnoremap <C-x> "+x
+    " Is performed by S+Ins
+    "autocmd VimEnter * nnoremap <C-v> "+p
+    "autocmd VimEnter * inoremap <C-v> <c-r>+
 endif
 
+" ctrl+d as EOF exits shells and the like. Add a keymap for the same here.
+nnoremap <C-d> :q<cr>
+
 nnoremap <C-p> :Denite file/rec<cr>
 nnoremap <space>/ :Denite grep:.<cr>
 nnoremap <space>s :Denite buffer<cr>
@@ -39,11 +50,26 @@ nmap ga <Plug>(EasyAlign)
 
 au Filetype gnuplot map <buffer> <F5> :call OpenIn("gnuplot -persist") <CR>
 
-au Filetype c,cpp,objc map <buffer> <F11> :vsplit<CR>:FSRight<CR>
-au Filetype c,cpp,objc map <buffer> <S-F11> :FSHere<CR>
+" 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 <buffer> <F12> :call FSvsplit()<CR>
+" Terminal-based vi report S-F12 as F24
+au Filetype c,cpp,objc map <buffer> <S-F12> :FSHere<CR>
+au Filetype c,cpp,objc map <buffer> <F24> :FSHere<CR>
 
 au Filetype markdown map <buffer> <F5> :call RunMarkdown()<CR>
-au Filetype asciidoc map <buffer> <F5> :call RunAsciidoc()<CR>
+au Filetype asciidoc,asciidoctor map <buffer> <F5> :call RunAsciidoc()<CR>
 
 " See https://github.com/artur-shaik/vim-Javacomplete2
 " <C-j>ji <leader>ji
@@ -63,8 +89,6 @@ au FileType java imap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 " Some plugin-specific settings
 
-" Add :imap to :map of plugin
-imap <C-l> <Plug>Unicoder
 
 
 if filereadable($HOME . '/.vim/keymaps-local.vim')