Wednesday, June 29, 2011

Improved saving of history in viminfo

It is known that if you launch multiple vim instances and then exit every
instance will overwrite history stored in viminfo, so only history from the last
vim instance will be added. Example:

Initial viminfo: one command ":echo 'Abc'" in history.
1. Launch vim 1, run ":echo 'Def'".
2. Launch vim 2, run ":echo 'Ghi'".
3. Exit vim 2.
4. Exit vim 1.
Viminfo history: ":echo 'Abc'", ":echo 'Def'".
Proposed history: ":echo 'Abc'", ":echo 'Ghi'", ":echo 'Def'".

How do you handle this situation (please don't reply if you ignore this issue)?

I have written a plugin for this, but guess it can be improved.

No comments: