On 01/04/09 17:56, Tim Chase wrote:
>
> Reckoner wrote:
>> when I have buffers open and I switch between them, I have noticed
>> that I lose the ability to undo changes in these buffers. In other
>> words, doing 'u' does not undo changes if that buffer has been
>> switched out of recently.
>
> Do you have 'hidden' set?
>
> :set hidden
>
> This should preserve your undo history.
>
> I tried digging around in the help to find supporting
> documentation, but couldn't find anything (looking in undo.txt,
> windows.txt, or editing.txt). The closest I was able to find was at
>
> :help bunload
>
> where it nebulously describes "The memory allocated for this
> buffer will be freed. The buffer remains in the buffer list."
> This freed memory seems to include undo-history.
>
> You may want to read up on the peculiarities of 'hidden'
>
> :help 'hidden'
> :help abandon
>
> Hope this helps,
>
> -tim
Another way to keep a buffer loaded is to leave it in a (split) window;
if you want this window not to use up too much real estate when not
current, you may want either to put it on a different tab page, or to
avail yourself of my "Rolodex Vim" functionality, as follows (in the vimrc):
if has("windows")
if has("autocmd")
augroup rolodex
au VimEnter * set noea wmh=0 wh=99999 hh=99999
augroup END
else
set noea wmh=0 wh=99999 hh=99999
endif
endif
The advantage (well, from my point of view) is that, even when not
current, the window in question has a statusline, possibly with a [+]
flag to remind me that it hasn't been saved on disk.
Outside the vimrc, just the ":set" line above is enough.
Best regards,
Tony.
--
A real patriot is the fellow who gets a parking ticket and rejoices
that the system works.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---