New answers tagged

2

See :h getcurpos() Basically there is an example: This can be used to save and restore the cursor position: > let save_cursor = getcurpos() MoveTheCursorAround call setpos('.', save_cursor) So you can try it with smth like (untested): nnoremap <C-f> :let save_cursor=getcurpos() <bar> %!clang-...


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 ...


Top 50 recent answers are included