> On Mar 18, 11:19 pm, "Benjamin R. Haskell" wrote:
> > [...]
> >
> > Turns out there's something in Gentoo's /etc/vim/vimrc that defeats
> > restoring the cursor column:
> >
> > " When editing a file, always jump to the last cursor position
> > autocmd BufReadPost *
> > \ if ! exists("g:leave_my_cursor_position_alone") |
> > \ if line("'\"") > 0 && line ("'\"") <= line("$") |
> > \ exe "normal g'\"" |
> > \ endif |
> > \ endif
> >
> > OpenSUSE (at work) has the non-broken (abbreviated):
> >
> > if has("autocmd")
> > autocmd BufReadPost *
> > \ if line("'\"") > 0 && line("'\"") <= line("$") |
> > \ exe "normal g`\"" |
> > \ endif
> > endif
> >
> > The difference in the executed commands is subtle:
> > g'"
> > versus
> > g`"
> >
> > But, perhaps your distribution has something that uses (perhaps
> > inadvertently) 'if line("'\"") > 1', for example. What system are
> > you on, precisely?
>
> Just to be clear... The version in my .vimrc appears to be correct...
>
> autocmd BufReadPost *
> \ if line("'\"") > 0 && line("'\"") <= line("$") |
> \ exe "normal g`\"" |
> \ endif
>
> ...yet I still experience the issue.
In your own .vimrc? or in a system-wide vimrc? Maybe there are two
commands being processed.
Either way, do you see anything odd in the output of:
:au BufReadPost *
Maybe something else is resetting the position as well.
--
Best,
Ben
--
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
To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
No comments:
Post a Comment