config/nvim/keys: reorder mappings

This commit is contained in:
xeruf 2021-05-08 20:23:57 +02:00
parent 3040ccda51
commit dab83792db
1 changed files with 28 additions and 27 deletions

View File

@ -1,21 +1,33 @@
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' <bar> 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 <bar> 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
" Alias replace all to S
nnoremap S :%s//gI<Left><Left><Left>
" Jump around without shift
nnoremap gl $
nnoremap gh 0
nnoremap gk H
nnoremap gj L
nnoremap gb G
let mapleader=" "
" Shortcut for quoting current WORD
nmap <leader>" ysiW"
" Alias write and quit to leader
@ -31,16 +43,6 @@ nnoremap <C-H> <C-W><C-H>
nnoremap <leader>h :split<Space>
nnoremap <leader>v :vsplit<Space>
" Alias replace all to S
nnoremap S :%s//gI<Left><Left><Left>
" Jump around without shift
nnoremap gl $
nnoremap gh 0
nnoremap gk H
nnoremap gj L
nnoremap gb G
" Enable and disable auto comment
map <leader>c :setlocal formatoptions-=cro<CR>
map <leader>C :setlocal formatoptions=cro<CR>
@ -51,7 +53,6 @@ map <leader>ls :setlocal colorcolumn=81,121 nowrap<CR>
map <leader>lw :setlocal colorcolumn=81 textwidth=80<CR>
map <leader>ln :setlocal colorcolumn= textwidth=0 wrap<CR>
" Quickly switch indentation settings
map <leader>t :setlocal shiftwidth=4 tabstop=4 noexpandtab<CR>
map <leader>T :setlocal shiftwidth=2 expandtab<CR>
" }}}