vim moving with hjkl in long lines (screen lines) -
the highlighted text array in want move. have press g before pressing j move line down. there mapping .vimrc can use hjkl move in screen lines without pressing g every time.
thanks matthias
i use following snippet helps forms of navigating, including things $ end of line , such.
" mapping make movements operate on 1 screen line in wrap mode function! screenmovement(movement) if &wrap return "g" . a:movement else return a:movement endif endfunction onoremap <silent> <expr> j screenmovement("j") onoremap <silent> <expr> k screenmovement("k") onoremap <silent> <expr> 0 screenmovement("0") onoremap <silent> <expr> ^ screenmovement("^") onoremap <silent> <expr> $ screenmovement("$") nnoremap <silent> <expr> j screenmovement("j") nnoremap <silent> <expr> k screenmovement("k") nnoremap <silent> <expr> 0 screenmovement("0") nnoremap <silent> <expr> ^ screenmovement("^") nnoremap <silent> <expr> $ screenmovement("$")
Comments
Post a Comment