"***************************************************************************** "" Abbreviations "***************************************************************************** "" no one is really happy until you have this shortcuts cnoreabbrev W! w! " force write cnoreabbrev Q! q! " force quit cnoreabbrev Qall! qall! " force quit all cnoreabbrev Wq wq " write and quit cnoreabbrev Wa wa " write all cnoreabbrev wQ wq " write and quit cnoreabbrev WQ wq " write and quit cnoreabbrev W w " write cnoreabbrev Q q " quit cnoreabbrev Qall qall " quit all "***************************************************************************** "" Mappings "***************************************************************************** noremap :w " save buffer " Split noremap h :split " horizontal split noremap v :vsplit " vertical split " Git noremap ga :Gwrite noremap gc :Git commit --verbose noremap gsh :Git push noremap gll :Git pull noremap gs :Git noremap gb :Git blame noremap gd :Gvdiffsplit noremap gr :GRemove " session management nnoremap so :OpenSession nnoremap ss :SaveSession nnoremap sd :DeleteSession nnoremap sc :CloseSession " Tabs nnoremap gt " next tab nnoremap gT " previous tab nnoremap :tabnew " new tab nnoremap . :lcd %:p:h " set working directory to the current file " Opens an edit command with the path of the currently " edited file filled in noremap e :e =expand("%:p:h") . "/" " Opens a tab edit command with the path of the currently " edited file filled noremap r :tabe =expand("%:p:h") . "/" " fzf.vim let $FZF_DEFAULT_COMMAND = "find * -path '*/\.*' -prune -o -path 'node_modules/**' -prune -o -path 'target/**' -prune -o -path 'vendor/**' -prune -o -path 'dist/**' -prune -o -type f -print -o -type l -print 2> /dev/null" cnoremap =expand("%:p:h") . "/" nnoremap b :Buffers nnoremap e :FZF -m " Recovery commands from history through FZF nmap y :History: " Tagbar nmap :TagbarToggle " open tagbar let g:tagbar_autofocus = 1 " Disable visualbell set noerrorbells visualbell t_vb= if has('autocmd') autocmd GUIEnter * set visualbell t_vb= endif "" Copy/Paste/Cut if has('unnamedplus') set clipboard=unnamed,unnamedplus endif noremap YY "+y " copy line noremap p "+gP " paste noremap XX "+x " cut if has('macunix') " pbcopy for OSX copy/paste vmap :!pbcopy " copy vmap :w !pbcopy " cut vmap :!pbpaste " paste endif "" Buffer nav noremap z :bp " previous buffer noremap x :bn " next buffer noremap bq :bp " previous buffer noremap bw :bn " next buffer noremap bd :bd " close buffer "" Switching windows noremap j " move to window below noremap k " move to window above noremap l " move to window right noremap h " move to window left vmap < >gv " move visual block right, keep selection vnoremap J :m '>+1gv=gv " move visual block down, keep selection vnoremap K :m '<-2gv=gv " move visual block up, keep selection nnoremap o :.GBrowse " open current line on GitHub nnoremap sh :terminal " open a new terminal nnoremap :noh " clean search