diff options
Diffstat (limited to '.vim/startup')
| -rw-r--r-- | .vim/startup/mappings.vim | 15 |
1 files 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 <expr> k (v:count == 0 ? 'gk' : 'k') +xnoremap <expr> k (v:count == 0 ? 'gk' : 'k') +nnoremap <expr> j (v:count == 0 ? 'gj' : 'j') +xnoremap <expr> j (v:count == 0 ? 'gj' : 'j') " Don't move cursor one character back on esc key press -inoremap <silent> <Esc> <C-O>:stopinsert<CR> +" inoremap <silent> <Esc> <C-O>:stopinsert<CR> " Don't get into insert mode after adding a line with o/O -nnoremap o o<Esc> -nnoremap O O<Esc> +" nnoremap o o<Esc> +" nnoremap O O<Esc> " Ctrl-Backspace deletes the previous word in insert mode. inoremap <C-h> <C-w> |
