diff options
| author | Syndamia <kamen@syndamia.com> | 2023-04-20 10:32:09 +0300 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2023-04-20 10:32:09 +0300 |
| commit | b4a93f91622d12f88e0feea497fe6c0dfdaf7b08 (patch) | |
| tree | 5b05186fbfce2792c927bcd1904cc2ea8cbaaed6 | |
| parent | 186380be733fffd5af5e0d3f02d3349598b2a480 (diff) | |
| download | dotfiles-b4a93f91622d12f88e0feea497fe6c0dfdaf7b08.tar dotfiles-b4a93f91622d12f88e0feea497fe6c0dfdaf7b08.tar.gz dotfiles-b4a93f91622d12f88e0feea497fe6c0dfdaf7b08.zip | |
[.vim/s/m] Better j and k, removed O stuff
| -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> |
