New answers tagged

1

Function that can handle a range for your case looks like this: func! CollapseLines() range let firstline = nextnonblank(a:firstline) let lastline = a:lastline + (firstline - a:firstline) execute firstline . "," . lastline . 's/\n/\t' endfunc :.,.+3call CollapseLines()<CR> Command with a function: func! CollapseLines(line1, ...


2

The swapfile full path is available through swapname() which takes a buffer name. The current buffer name is available with bufname() with no arguments. So this prints the swapfile path of the current buffer echo swapname(bufname()) If you want just the filename you'd use fnamemodify() along with the filename modifier :t (for "tail"). And if you ...


Top 50 recent answers are included