Friday, June 1, 2018

Re: First line starting with space affects cursor position when switching buffers

On 31.05.18 23:25, dmccooey@comcast.net wrote:
> Place the cursor on the last line (or any line other than the first line).
> Save the file (:w) and switch (:e) to view another file.
> Switch back (:e) to the original file.
> Notice that the cursor is on the first line, not where it was originally.

A fresh edit (:e) is not a jump list return, so the behaviour is to be
expected. Try the ":bu" command instead, for better results.

Alternatively, the :help on ^O and ^I is terse, but do briefly describe
how to go back up the jump list, across files. Admittedly that is
laborious, but the following may be a useful alternative to :bu-ing about.

" Alt-O & Alt-I between files, just as ^O & ^I retrace move history:
" Thanks to Marcin Szamotulski.

nm <A-o> :call FileJump(v:count1, 'b')<cr>
nm <A-i> :call FileJump(v:count1, 'f')<cr>

Erik

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment