New answers tagged

2

How do I get the column of the cursor independently of how the selection was made? Let's make it clear: at this point you're already in the normal mode. All you can get is the selection range, not the cursor position at the time it was made. And so col('.') correctly returns the current cursor position, not the previous one. Your confusion is based on an ...


1

An alternative implementation which does not stop at the first error in a script: command! -range=% Exec call execute(getline(<line1>, <line2>), '') Now in visual mode type :'<,'>Exec to process the selected lines ('<,'> is added automatically as usual). Also, :Exec in normal mode executes the whole buffer, just as :source %, except ...


Top 50 recent answers are included