Am 16.01.2013 19:16, schrieb Asis Hallab:> Dear Vimmers,
Yep, looks like there is something "wrong" in Vim:
:yank, :change, :append/:insert, :delete
getline(), setline(), append(), ?delete()?
There should be a function delete() to delete lines without moving the
cursor, but the function of this name already deletes a file. And there
is no other equivalent function.
You can use
:h winsaveview()
:h winrestview()
to save/restore the cursor position;
or
:let savpos = getpos(".")
...
:call cursor(savpos[1:])
" or :call setpos(".", savpos)
or a mark ...
--
Andy