Wednesday, September 8, 2010

Re: Dealing with viminfo overwriting? -> :set vi=n..

On Wed, 8 Sep 2010, Sven Guckes wrote:

> * Benjamin R. Haskell [2010-09-08 16:36]:
> > It's only within the last few years that Vim has become my main
> > editor.
>
> (but apparently not for edting emails.. you can tell by the trailing
> spaces ;-)

The whitespace is intentional. I still haven't gotten around to
fully automating the process of reformatting others' text, but I tend to
'gqap' quite frequently.

From my ~/.vim/alpine.vim:
set fo+=w

From :h 'fo-table':

w Trailing white space indicates a paragraph continues in the next line.
A line that ends in a non-white character ends a paragraph.

Alpine sends 'flowed text'[1] by default, which is what I prefer.

[1] http://joeclark.org/ffaq.html


> > Now that I tend to use many vim instances at a time, I'm finding it
> > frustrating that I'm losing much of my command history due to firing
> > up 'temporary' sessions that overwrite more useful history. A
> > feature of Zsh that I really love is INC_APPEND_HISTORY, where
> > history items are appended into history as soon as they're entered,
> > instead of appending the whole shell session's history upon exiting.
> > Is there any similar capability for viminfo?
>
> no.. vim does not have an option for "merging" of viminfo files.
>
> > How does everyone here deal with this kind of problem?
>
> tell vim to write its info into separate viminfo files.
>
> you could start vim from different directories which have their own
> vimrc, directing it to use a special (local) viminfo file, eg:
>
> :set vi=n.viminfo
> :set vi=n~/.vim/viminfo.foo
>
> i had been thinking about this for over a decade now.. but all
> solutions seem to have been too hard to handle. ;)

Interesting idea. Kind-of solves half of the problem (prevents losing
.viminfo data), but doesn't seem to lend itself to the other part of
what I want (contents of all .viminfos' command histories available from
everywhere).

I wish more Vim options had the 'backupdir'-style trailing-'//'
available. (E.g. I use backupdir=~/.vim-tmp// to prevent splattering
.swp files everywhere.) In this case,
set vi=n~/.vim/info//
could set the viminfo file for /foo/bar/baz to ~/.vim/info//%foo%bar%baz

--
Best,
Ben

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

Post a Comment