From dab83792dbdb823fac085563eadf20260a31c70a Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Sat, 8 May 2021 20:23:57 +0200 Subject: [PATCH] config/nvim/keys: reorder mappings --- .config/nvim/init/keys.vim | 55 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/.config/nvim/init/keys.vim b/.config/nvim/init/keys.vim index 4600efa..45fcde0 100644 --- a/.config/nvim/init/keys.vim +++ b/.config/nvim/init/keys.vim @@ -1,47 +1,49 @@ -let @c = '/^\n i```Ni```j0/``` lllkxNA' - " Save file as root when I forgot to use sudoedit cnoremap w!! execute 'write !sudo tee % >/dev/null' edit! -" Write file & source vimrc (really only makes sense from within vimrc to quickly test changes) +" Write file & source vimrc +" For quickly testing changes while editing vimrc command! WS write source $MYVIMRC command! FormatJSON %!python -m json.tool -command! DiffSwap :diffsp % " Diff for swap - replaced by 'chrisbra/Recover.vim' -"command! for dictcc +command! DiffSwap :diffsp % " Diff for swap - superseded by 'chrisbra/Recover.vim' + +" @c now takes an indented code block and surrounds it in backticks instead +let @c = '/^\n i```Ni```j0/``` lllkxNA' " Sane yanking map Y y$ " Disable Ex mode - https://vi.stackexchange.com/q/457 nnoremap Q @q - -let mapleader=" " -nmap " ysiW" - - " Alias write and quit to leader -nnoremap q :wq -nnoremap w :w - - " Easy split navigation -nnoremap -nnoremap -nnoremap -nnoremap - " Shortcut split opening -nnoremap h :split -nnoremap v :vsplit - - " Alias replace all to S +" Alias replace all to S nnoremap S :%s//gI - " Jump around without shift +" Jump around without shift nnoremap gl $ nnoremap gh 0 nnoremap gk H nnoremap gj L nnoremap gb G + +let mapleader=" " - " Enable and disable auto comment +" Shortcut for quoting current WORD +nmap " ysiW" + +" Alias write and quit to leader +nnoremap q :wq +nnoremap w :w + +" Easy split navigation +nnoremap +nnoremap +nnoremap +nnoremap +" Shortcut split opening +nnoremap h :split +nnoremap v :vsplit + +" Enable and disable auto comment map c :setlocal formatoptions-=cro map C :setlocal formatoptions=cro @@ -51,7 +53,6 @@ map ls :setlocal colorcolumn=81,121 nowrap map lw :setlocal colorcolumn=81 textwidth=80 map ln :setlocal colorcolumn= textwidth=0 wrap +" Quickly switch indentation settings map t :setlocal shiftwidth=4 tabstop=4 noexpandtab map T :setlocal shiftwidth=2 expandtab - -" }}}