Re: Remember where I left off

2006-12-20 Thread Charles E Campbell Jr

Jason Morehouse wrote:

I recall at one point, Vim would remember where I left off in a file, 
and place me back there when I started.  I don't think it's worked 
since I switch to 7, and don't recall the vimrc setting.  Any ideas?


Check out tip Restore cursor to file position in previous editing 
session at

   http://vim.sourceforge.net/tips/tip.php?tip_id=80

Regards,
Chip Campbell



Remember where I left off

2006-12-19 Thread Jason Morehouse

Heya,

I recall at one point, Vim would remember where I left off in a file, 
and place me back there when I started.  I don't think it's worked since 
I switch to 7, and don't recall the vimrc setting.  Any ideas?


Thanks,
-J


Re: Remember where I left off

2006-12-19 Thread A.J.Mechelynck

Jason Morehouse wrote:

Heya,

I recall at one point, Vim would remember where I left off in a file, 
and place me back there when I started.  I don't think it's worked since 
I switch to 7, and don't recall the vimrc setting.  Any ideas?


Thanks,
-J



Method I (recommended)

Make sure that one (*not* both) of the following lines is included near the 
top of your vimrc. Everything can go after it except set nocompatible (if 
used) and a :language command (if used):


source $VIMRUNTIME/vimrc_example.vim
or
runtime vimrc_example.vim

Since this script sets a number of options (in most cases to what is IMHO 
preferable than the default) you should then review your settings and possibly 
add some tweaks after the point in your vimrc where the vimrc_example is invoked.


Method II
-
Near the end of the vimrc_example there is an autocommand definition, as 
follows:

   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).
  autocmd BufReadPost *
\ if line('\)  0  line('\) = line($) |
\   exe normal! g`\ |
\ endif

Paste that into your vimrc.



Best regards,
Tony.


Re: Remember where I left off

2006-12-19 Thread Bill McCarthy
On Tue 19-Dec-06 6:41pm -0600, Jason Morehouse wrote:

 I recall at one point, Vim would remember where I left off in a file,
 and place me back there when I started.  I don't think it's worked since
 I switch to 7, and don't recall the vimrc setting.  Any ideas?

It hasn't changed.  The normal command is `0.

Removing shell specific escaping, you could write an alias
for when you want that behavior:

gvim +sil! normal `0

In 4nt on Windows, it looks like this:

gvim +sil! normal ^`0

-- 
Best regards,
Bill