From b4a93f91622d12f88e0feea497fe6c0dfdaf7b08 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 20 Apr 2023 10:32:09 +0300 Subject: [.vim/s/m] Better j and k, removed O stuff --- .vim/startup/mappings.vim | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.vim/startup/mappings.vim b/.vim/startup/mappings.vim index 8d62941..001589a 100644 --- a/.vim/startup/mappings.vim +++ b/.vim/startup/mappings.vim @@ -47,17 +47,18 @@ " }}} " When line is wrapped, going up or down will also go into the wrapped part -nnoremap j gj -nnoremap k gk -xnoremap j gj -xnoremap k gk +" move in wrapped lines when no count prefix +nnoremap k (v:count == 0 ? 'gk' : 'k') +xnoremap k (v:count == 0 ? 'gk' : 'k') +nnoremap j (v:count == 0 ? 'gj' : 'j') +xnoremap j (v:count == 0 ? 'gj' : 'j') " Don't move cursor one character back on esc key press -inoremap :stopinsert +" inoremap :stopinsert " Don't get into insert mode after adding a line with o/O -nnoremap o o -nnoremap O O +" nnoremap o o +" nnoremap O O " Ctrl-Backspace deletes the previous word in insert mode. inoremap -- cgit v1.2.3