Commands
Toggle Wrapped Lines
Same function in Lua (for Neovim)
noremap <silent> <Leader>tw :call ToggleWrap()<CR>
function ToggleWrap()
if &wrap
echo "Wrap OFF"
setlocal nowrap
set virtualedit=all
else
echo "Wrap ON"
setlocal wrap linebreak nolist
set virtualedit=
setlocal display+=lastline
endif
endfunction
vimscript
Character Manipulation
:5,8del | let x=split(@") | 1,4s/$/\=remove(x,0)/
vimscript
:%s/[^total:]*$//g
vimscript
:%s/[^total:]*$//g
vimscript
Select visual block from start to "foo"
Pressing down Shift
or Ctrl
, followed by v
(so that two key are depressed at the same time) will visually select a row or a cell, respectively.
Now, press /
and type foo
to select from this current selection until the first instance of foo
.
Hit Return
(or Enter
) to accept. Press n
to advance to the next instance, or hold Shift
and press n
to go back to a previous instance.