Monday, May 10, 2010

Re: Automatic sessions

On Monday 10 May 2010 8:38:38 pm Udo Hortian wrote:

> recently I was using vim on a OpenSuse system. I found that
> when I was editing a file with vim, closed vim and opened
> this file again with vim, I found myself at the same position
> in the file as before. I am not sure, but I guess this was
> done via sessions. How can I get this working on my system
> (Debian squeeze, vim 7.2.330-1)?

it sounds to me as if the oS install had sourced the
$VIMRUNTIME/vimrc_example.vim, which contains the following code:

" When editing a file, always jump to the last known cursor
position.
" Don't do it when the position is invalid or when inside an
event handler
" (happens when dropping a file on gvim).
" Also don't do it when the mark is in the first line, that is
the default
" position when opening a file.
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif

you can either source that same file (dangerous in my opinion) or
add the above code to your .vimrc

hth,

sc

--
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

No comments: