Friday, March 15, 2013

Re: make vim remember where I left

On 15/03/2013 21:29, FlashBurn wrote:

> Like most of us I open plenty of files at the same time with vim. The problem is that whenever I go from file 1 to file 2 and then back to file 1, Vim doesn't remember where I left off. It opens the file and puts the cursor on line 1. Is there a way to make it remember to put the cursor where I left off?
> Any help is appreciated.
>

Try this in your vimrc:

autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif

Cheers,

Phil...

--
--
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/groups/opt_out.

No comments: