In vim, if you swap buffers with :bn and :bp, the cursor stays on the same line, but not on the same column. Is there a way to keep it on the same column as well ?
+3
A:
Off the top of my head I don't think so. But Vim sets the mark " as the last position when exiting a buffer. So typing `" will get you back to that spot. You could try creating an auto-command to jump to that mark automatically on entering a buffer. Try something like
:au BufEnter * :normal `"
Steve K
2009-08-02 19:06:37
it works! thanks! you changed my life.
Stefano Borini
2009-08-02 22:23:43
+1
A:
:set nostartofline
from the help: "In case of buffer changing commands the cursor is placed at the column where it was the last time the buffer was edited."
rpilkey
2009-08-03 08:21:16