diff --git a/vimrc.d/mappings.vim b/vimrc.d/mappings.vim index 4aeac35..7696571 100644 --- a/vimrc.d/mappings.vim +++ b/vimrc.d/mappings.vim @@ -1,22 +1,31 @@ " key #mappings{{{ let mapleader = ' ' +" miscallaneous +"{{{ nnoremap rc :so $MYVIMRC - +nnoremap nn :set invrelativenumber +nnoremap nh (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n" +inoremap jk +nnoremap A :call CheckLineEnding() +nnoremap co :!clear; " Focus on current fold, close the rest nnoremap zz zMzvzt - " replace current word with last yanked/deleted text nnoremap rr "_diwP " replace current word with last yanked text nnoremap ry diw"0P +" quick grep of visual selection +vnoremap gr y:grep! -R " . +" open quickfix window of TODOs +nnoremap td :grep! -R '// *TODO' .:botright cwindow:echo len(getqflist()) 'TODOs' +" devdocs mapping +nnoremap dd :DD -inoremap jk - -nnoremap A :call CheckLineEnding() - -nnoremap co :!clear; +"}}} +" git mappings +"{{{ nnoremap gs :Gstatus nnoremap gd :Gdiff nnoremap gD :!clear; echo 'git diff'; git diff @@ -24,17 +33,22 @@ nnoremap ga :!clear; git add %; git status nnoremap gA :!clear; git add .; git status nnoremap gc :Gcommit nnoremap gg :!clear; git add %; git commit -m '' -" nnoremap gp :pedit | read ! echo 'git push'; git push nnoremap gp :!clear; echo 'git push'; git push +" nnoremap gp :terminal echo ':git push' & git push " nnoremap gp :Gpush +" nnoremap gp :pedit | read ! echo 'git push'; git push nnoremap gl :Glog +"}}} " netrw +"{{{ nnoremap ex :Ex nnoremap ee :e . nnoremap eq :Rex +"}}} -" better window navigaton +" better window management +"{{{ nnoremap h nnoremap l nnoremap k @@ -45,8 +59,10 @@ nnoremap k :resize +5 nnoremap l :vertical resize +5 nnoremap h :vertical resize -5 nnoremap = = +"}}} "location list and quickfix mappings +"{{{ nnoremap lo :botright lwindow nnoremap :lprevzv nnoremap :lnextzv @@ -62,14 +78,10 @@ nnoremap qc :cclose nnoremap qh :chistory nnoremap qp :colder nnoremap qn :cnewer - -" quick grep of visual selection -vnoremap gr y:grep! -R " . - -" open quickfix window of TODOs -nnoremap td :grep! -R '// *TODO' .:botright cwindow:echo len(getqflist()) 'TODOs' +"}}} " brace/quotes completion +"{{{ inoremap {{ {} inoremap { {}O inoremap {; {};O @@ -87,12 +99,8 @@ inoremap '' '' inoremap '; ''; inoremap ;; ; +"}}} -nnoremap nn :set invrelativenumber -nnoremap nh (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n" - -" devdocs mapping -nnoremap dd :DD "}}} " #abbreviations{{{