" dotfiles -- .vim/vimrc_files/keymaps.vim " author: johannst " set leader key let mapleader="," " re-source .vimrc map v :source ~/.vimrc "remap esc button imap jj " prevent quit accidentlty map :q :bd map :qa :bd map :wq :w:bd noremap q :q " re-adjust indentation map f mzgg=G`z "let ArrowDisableMessage = "Arrow Keys disabled! Better learn hjkl ;)" " Disable arrow keys -- train jklh " nnoremap :echo ArrowDisableMessage " nnoremap :echo ArrowDisableMessage " nnoremap :echo ArrowDisableMessage " nnoremap :echo ArrowDisableMessage " " vnoremap :echo ArrowDisableMessage " vnoremap :echo ArrowDisableMessage " vnoremap :echo ArrowDisableMessage " vnoremap :echo ArrowDisableMessage " " inoremap :echo ArrowDisableMessage " inoremap :echo ArrowDisableMessage " inoremap :echo ArrowDisableMessage " inoremap :echo ArrowDisableMessage " ctrl-hjkl move in insert mode inoremap inoremap inoremap inoremap " ctrl-jk movement in command window cnoremap cnoremap cnoremap cnoremap " navigate between different splits map j map k map l map h " resize splits map 5- map 5+ map 5< map 5> " navigate between different buffers nnoremap :bprevious nnoremap :bnext " ctrl-ae jump to line start/end nnoremap 0 nnoremap $ inoremap 0 inoremap $ vnoremap 0 vnoremap $ cnoremap cnoremap " Shortcut to toggle relative numbering mode nnoremap :call ToggleRelativeNumber() " add a marker fold snippet (for C/C++) nnoremap o//{{{ o//}}}A imap " only works with v-block (not v-line) vnoremap VV''>o//}}}'<A " substitute selection vnoremap "hy:%s/h//gc " +-----------------+ " | Plugin specific | " +-----------------+ " Open BufferExplorer nnoremap :call BufExplorer() " Toggle Tagbar nnoremap t :TagbarToggle " build tags of your own project with Ctrl-F12 map :!ctags -R --sort=yes --c++-kinds=+pl --fields=+iaS --extra=+q --language-force=C++ .