From 6e6d769d6c729c71b2f28aaffa9a5b3fc013fcaf Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 5 Dec 2021 20:36:40 +0000 Subject: [PATCH] Update bindings and add consistency --- init.vim | 138 +++++++++++++++++++++++++++---------------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/init.vim b/init.vim index 571aca9..e2dd050 100644 --- a/init.vim +++ b/init.vim @@ -94,21 +94,21 @@ set splitright "We'll set simpler mappings to switch between splits "Decrease window size (replaces some weird netrw stuff) -nnoremap - +nnoremap - "Increase window size (Redraws the screen, use :redraw instead) -nnoremap + -nnoremap -nnoremap +nnoremap + +nnoremap +nnoremap nnoremap nnoremap "Decrease window size (Backspace clone) -inoremap - +inoremap - "Increase window size (Replaces leaving `insertmode`, don't use `insertmode`) -inoremap + -inoremap i -inoremap i -inoremap i -inoremap i +inoremap + +inoremap i +inoremap i +inoremap i +inoremap i " }}} " Search --- {{{ @@ -121,92 +121,92 @@ set path+=** " Mappings --- {{{ " Editing files - {{{ "Make it easy to edit the vimrc file -nnoremap ev :tabedit $MYVIMRC +nnoremap ev :tabedit $MYVIMRC "Source the vimrc file -nnoremap es :source $MYVIMRC +nnoremap es :source $MYVIMRC " }}} "Changing unused ctrl bindings "Turn on git blame -nnoremap GBlame +nnoremap GBlame "List all tags in the current buffer (replaced pageup, use CTRL-u instead) -nnoremap BTags +nnoremap BTags "List all tags in directory -nnoremap Tags +nnoremap Tags "List all the recently opened files (replaced scroll one line up, use "k") -nnoremap History +nnoremap History "Search within the current buffer (replaced pagedown, use CTRL-d instead) -nnoremap / +nnoremap / "Search within the whole project -nnoremap Rg +nnoremap Rg "Move line down (uses vim-unimpaired) (replaced move down, use "j") -nnoremap +nnoremap "Move line up (uses vim-unimpaired) (replaced move up, use "k") -nnoremap +nnoremap "Does not work because of legacy reasons -" nnoremap +" nnoremap "Search marks (replaced "j" clone) -nnoremap Marks +nnoremap Marks "Search version controlled files (replaced move up, use "k") -nnoremap GFiles +nnoremap GFiles "Search all files in directory -nnoremap Files +nnoremap Files "Toggle file draw -nnoremap CHADopen +nnoremap CHADopen "Search all snippets (uses ultisnips) -nnoremap Snippets +nnoremap Snippets "Search git history (replaced scroll one line up, use "k") -nnoremap Commits +nnoremap Commits "Search git history within current buffer/selection -nnoremap BCommits +nnoremap BCommits "Turn on git blame -inoremap GBlame +inoremap GBlame "List all tags in the current buffer -inoremap BTags +inoremap BTags "List all tags in directory -inoremap Tags +inoremap Tags "List all the recently opened files (replaced inserting characters from below) -inoremap History +inoremap History "Search within the current buffer -inoremap / +inoremap / "Search within the whole project -inoremap Rg +inoremap Rg "Move line down (uses vim-unimpaired) (replaced clone) -inoremap ddpi +inoremap ddpi "Move line up (uses vim-unimpaired) (replaced start digraph, use command instead) -inoremap ddkPi +inoremap ddkPi "Does not work because of legacy reasons -" inoremap Marks +" inoremap Marks "Add line below (replaced execute single command in normal) -inoremap o +inoremap o "Add line above -inoremap O +inoremap O "Search version controlled files (replaced autocomplete reverse) -inoremap GFiles +inoremap GFiles "Search all files in directory -inoremap Files +inoremap Files "Toggle file draw (replaces CTRL-v clone) -nnoremap CHADopen +nnoremap CHADopen "Search all snippets (uses ultisnips) -inoremap Snippets +inoremap Snippets "Search git history (replaced inserting characters from above) -inoremap Commits +inoremap Commits "Search git history within current buffer/selection -inoremap BCommits +inoremap BCommits "Add simple highlight removal -nnoremap :nohlsearch +nnoremap :nohlsearch "Convert tabs to spaces -nnoremap :retab +nnoremap :retab "Git mappings -nnoremap ga :Git add % -nnoremap gb :Git blame -nnoremap gC :Git commit -nnoremap gp :Git push -nnoremap gP :Git pull +nnoremap ga :Git add % +nnoremap gb :Git blame +nnoremap gC :Git commit +nnoremap gp :Git push +nnoremap gP :Git pull "Map movement keys to Escape inoremap jj @@ -215,7 +215,7 @@ inoremap kk inoremap hh "Delete a line in insert mode -" inoremap ddi +" inoremap ddi "Use semicolon instead of colon for commands nnoremap ; : @@ -226,19 +226,19 @@ inoremap ; mzA;`za nnoremap ; mzA;`za "Easily navigate items in the quickfix menu -nnoremap ] :cnext -nnoremap [ :cprevious +nnoremap ] :cnext +nnoremap [ :cprevious "Indent arrays -nnoremap { mzF[`a``%i`z -nnoremap } mzF[`a``%i`zvi[:s/,\s*/,\r/gvi[=`z:nohlsearch +nnoremap { mzF[`a``%i`z +nnoremap } mzF[`a``%i`zvi[:s/,\s*/,\r/gvi[=`z:nohlsearch "A command to properly indent json code command! FormatJSON %!python -m json.tool " Allow saving of files as doas -command! W execute 'silent! w !doas /usr/bin/tee % >/dev/null' edit! -command! X execute 'silent! x !doas /usr/bin/tee % >/dev/null' edit! +command! W execute 'silent! w !doas /usr/bin/tee % >/dev/null' edit! +command! X execute 'silent! x !doas /usr/bin/tee % >/dev/null' edit! " }}} @@ -250,22 +250,22 @@ function ToggleEmmet() if g:emmet_completion echo "Emmet completion off!" let g:user_emmet_expandabbr_key=',' - iunmap + iunmap let g:emmet_completion = 0 else echo "Emmet completion on!" let g:user_emmet_expandabbr_key='' - imap emmet#expandAbbrIntelligent("\") + imap emmet#expandAbbrIntelligent("\") let g:emmet_completion = 1 endif endfunction -nnoremap em :call ToggleEmmet() +nnoremap em :call ToggleEmmet() " Conceal markdown text set conceallevel=3 let g:AutoPairsFlyMode = 1 -let g:AutoPairsShortcutBackInsert = '' " Use to insert the closing parentheses if it jumped ahead by mistake +let g:AutoPairsShortcutBackInsert = '' " Use to insert the closing parentheses if it jumped ahead by mistake let g:chadtree_settings = { \ 'theme': { @@ -321,12 +321,12 @@ nnoremap L $ " }}} " Operator mappings --- {{{ -onoremap in( :normal! f(vi( -onoremap il( :normal! F)vi( -onoremap an( :normal! f(va( -onoremap al( :normal! F)va( -onoremap an{ :normal! f{vi{ -onoremap al{ :normal! F}vi +onoremap in( :normal! f(vi( +onoremap il( :normal! F)vi( +onoremap an( :normal! f(va( +onoremap al( :normal! F)va( +onoremap an{ :normal! f{vi{ +onoremap al{ :normal! F}vi " }}} " Abbreviations --- {{{