nnoremap let g:mapleader = ' ' " Quickly insert an empty new line without entering insert mode nnoremap o o nnoremap O O " workman noremap noremap noremap e j noremap o k noremap n h noremap i l noremap k n noremap h e noremap l o noremap f u noremap u i noremap E J noremap O K noremap N H noremap I L noremap K N noremap H E noremap L O noremap F U noremap U I noremap ge gj noremap go gk noremap gn gh noremap gl go noremap gk gn noremap gh ge noremap gE gJ noremap gN gH noremap gK gN noremap gH gE noremap gL gO nnoremap e :wincmd j nnoremap o :wincmd k nnoremap n :wincmd h nnoremap i :wincmd l nnoremap k :wincmd n nnoremap l :wincmd o vnoremap B vnoremap W nnoremap B nnoremap W vnoremap b vnoremap w nnoremap b nnoremap w " nnoremap i e " get control-j back, so switch it with ctrl-n at qwerty position of j " imap " cmap inoremap cnoremap " half scroll up and down noremap noremap map " jump word in visual mode -- TODO " In insert or command mode, move normally by using Ctrl inoremap inoremap inoremap inoremap cnoremap cnoremap cnoremap cnoremap inoremap inoremap inoremap :+3i inoremap :-3i " easy config nmap :e $HOME/.vimrc nmap :so $HOME/.vimrc " Force saving files that require root permission command! SUDOwrite :execute 'w !sudo tee > /dev/null %' | edit! " TODO: C-S-o etc does not work " Bubble single lines nmap :m-2== nmap :m-2== nmap :m+== nmap :m+== imap :m-2==gi imap :m-2==gi imap :m+==gi imap :m+==gi " Bubble multiple lines vmap :m-2gv=gv vmap :m-2gv=gv vmap :m'>+gv=gv vmap :m'>+gv=gv " Indent lines using and vmap >gv nmap >> imap >>i vmap << imap < :lprevious " noremap :lnext " moving through buffers " noremap :bn " noremap :bp noremap bd :bd noremap wc :bd noremap bo :Bufonly " close preview nmap pc :pc " Remap window commands " map ws :wincmd s " map wv :wincmd v " map wc :wincmd c " map wn :wincmd n " map wo :wincmd o " map w+ :wincmd _ " map w- :wincmd " map w= :wincmd = " nmap + :vertical resize +20 " nmap - :vertical resize -20 " map :wincmd > " map :wincmd j " map :wincmd j " map :wincmd k " map :wincmd k " map :wincmd h " map :wincmd h " map :wincmd l " map :wincmd l " " nnoremap :wincmd k " nnoremap :wincmd j " nnoremap :wincmd h " nnoremap :wincmd l " inoremap :wincmd k " inoremap :wincmd j " inoremap :wincmd h " inoremap :wincmd l nnoremap :wincmd k nnoremap :wincmd j nnoremap :wincmd h nnoremap :wincmd l nnoremap :wincmd k nnoremap :wincmd j nnoremap :wincmd h nnoremap :wincmd l inoremap :wincmd k inoremap :wincmd j inoremap :wincmd h inoremap :wincmd l nnoremap :wincmd K nnoremap :wincmd J nnoremap :wincmd H nnoremap :wincmd L inoremap :wincmd K inoremap :wincmd J inoremap :wincmd H inoremap :wincmd L " tags nmap :exec("tjump ".expand("")) nmap :split:exec("tjump ".expand("")) " trigger NERDTree, Tagbar $ Co. " nmap n :NERDTreeToggle " nmap t :TagbarToggle " nmap f "zyaw :exe ":Ack ".@z."" " grep word under cursor nnoremap f :lgr! "\b\b":cw " paste from system clipboard inoremap :set paste"+p :set nopaste " toggle spellcheck nmap :setlocal spell! spelllang=en_us " cursor jump " nnoremap 3k " inoremap :-3i " vnoremap 3k " nnoremap 3j " inoremap :+3i " vnoremap 3j " nnoremap 6k " inoremap :-6i " vnoremap 6k " nnoremap 6j " inoremap :+6i " vnoremap 6j nnoremap 3k vnoremap 3k nnoremap 3j vnoremap 3j nnoremap 6k vnoremap 6k nnoremap 6j vnoremap 6j " scrolling nnoremap 10 inoremap 10i vnoremap 10 nnoremap 10 inoremap 10i vnoremap 10 nnoremap 10 inoremap 10i vnoremap 10 nnoremap 10 inoremap 10i vnoremap 10 " F keys " nmap :noh " imap :noh noremap :FufBuffer nmap :call ManCurrentWord() " nmap :call DevHelpCurrentWord() " nmap " remap visual block nnoremap " write noremap :w inoremap :w " exit noremap :qa! inoremap :qa! " paste nnoremap "+gPl vnoremap :call Paste("v") inoremap :call Paste("i") " select all nnoremap ggVG inoremap :call Select() nnoremap cd :cd %:p:h:pwd nnoremap cc :cclose nnoremap co :copen function! ToggleQuickFix() if empty(filter(getwininfo(), 'v:val.quickfix')) copen else cclose endif endfunction function! ToggleLocList() if empty(filter(getwininfo(), 'v:val.loclist')) lopen else lclose endif endfunction nnoremap :call ToggleQuickFix() nnoremap :call ToggleLocList() " PLUGINS " NERDTree noremap :NERDTreeToggle " noremap :TagbarToggle inoremap :TagbarToggle " vista nmap :Vista!! " NERDComment nnoremap :call NERDComment("n", "Toggle") vnoremap :call NERDComment("v", "Toggle") " YCM nmap :YcmCompleter GoTo:wincmd o " vim-clap nnoremap ag :Clap grep2 ++query= nnoremap tg :Clap proj_tags ++query= nmap :Clap files nmap :Clap tags nmap :Clap buffers " gitgutter nmap ggt :GitGutterToggle nmap nh (GitGutterNextHunk) nmap bh (GitGutterPrevHunk) " tig " let g:tig_explorer_keymap_edit = '' " let g:tig_explorer_keymap_tabedit = '' " let g:tig_explorer_keymap_split = '' " let g:tig_explorer_keymap_vsplit = '' " nnoremap T :TigOpenCurrentFile " nnoremap t :TigOpenProjectRootDir " nnoremap g :TigGrep " nnoremap r :TigGrepResume " vnoremap g y:TigGrep" " nnoremap cg ::TigGrep " nnoremap b :TigBlame " ghcup " nnoremap ghc :GHCup " git gutter omap ic (GitGutterTextObjectInnerPending) omap ac (GitGutterTextObjectOuterPending) xmap ic (GitGutterTextObjectInnerVisual) xmap ac (GitGutterTextObjectOuterVisual) " fastfold nmap zuz (FastFoldUpdate) "LanguageClient-neovim " Required for operations modifying multiple buffers like rename. set hidden nnoremap lc :call LanguageClient_contextMenu() " Or map each action separately nnoremap T :call LanguageClient#textDocument_hover() nnoremap gd :call LanguageClient#textDocument_definition() " nnoremap :call LanguageClient#textDocument_rename() " nnoremap ld :call LanguageClient#textDocument_definition() " nnoremap lr :call LanguageClient#textDocument_rename() " nnoremap lf :call LanguageClient#textDocument_formatting() " nnoremap lt :call LanguageClient#textDocument_typeDefinition() " nnoremap lx :call LanguageClient#textDocument_references() " nnoremap la :call LanguageClient_workspace_applyEdit() " nnoremap lc :call LanguageClient#textDocument_completion() " nnoremap lh :call LanguageClient#textDocument_hover() " nnoremap ls :call LanguageClient_textDocument_documentSymbol() " nnoremap lm :call LanguageClient_contextMenu()