Hello,

I'm also using vim with an Ubuntu Feisty. Here is what I have in my .vimrc:

" Try to restore cursor position when reading a buffer
au BufReadPost * if line("'\"") | exe "normal '\"" | endif

It works quite well.

On 5/9/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] wrote:
>
> When opening a file in vim, the cursor will move to the last position when
> the file was saved.
>
> The "feature" is enabled by some autocommands in vimrc_example.vim, I
> copied the code into my .vimrc and use it in all platform.
>
> It really does work in my WindowsXP gvim, cygwin vim, MacOSX vim, and
> Ubuntu Dapper vim.
>
> Recently I installed Ubuntu Feisty and the "feature" seems to have gone (I
> installed vim-gnome version 7.0.135). Since I use the same .vimrc in all
> platform, it is unlikely to be the fault of my .vimrc script, the problem
> is I do not know how to debug vim script, and I don't know why that
> autocommand does not work.
>
> Any idea where is the problem, or any hint on how to find where the problem
> is?
>
> --
> Sincerely, Pan, Shi Zhu. ext: 2606
>

IIUC, it requires both +autocmd and +viminfo -- IOW, at least a "Normal"
version. "Tiny" or "small" (including the version of vim installed under the
name "vi" by the RedHat package "vim-minimal") won't have it. (Sorry, I don't
know the Ubuntu package names.)


Best regards,
Tony.
--
"APL is a write-only language.  I can write programs in APL, but I
can't read any of them."
                -- Roy Keir

Reply via email to