Is there a Vim plugin that allows me to save/load registers to/from files with minimal typing, preview of registers, and other amenities?
Vim has a lot of registers. However, the "only" ones that serve a "storage" purpose are registers
- only the user can edit them and only by explicitly naming them (whereas numbered registers change, or actually shift, automatically),
- they don't affect and are not affected by the "outside world" (
*do affect and are affected by what happens outside of Vim),
- they have no special behavior (
_is the black hole,
"is the last used register, and so on).
Now, for me it's natural to resort to
z registers when I want to put stuff there that I might reuse several times during a workday. However, the various usages often depends on what I'm doing.
There are times when I'm debugging C++ code, that I often need to efficiently (from they keystroke standapoint) load the same, say, 4 or 5 dynamic libraries everytime I restart the debug session, so it's very useful to have those libraries (or the whole line for gdb
-exec shared somelibrary.so) in the registers.
Much less often, but still not only once in a lifetime, there are times when I'm doing some text editing that requires that I run the same few macros I run a month ago.
It would be nice to have registers' contents saved in "databases". For instance, having a file named
dynamicLibrariesLoadCmds.txt with content such as
a: -exec shared somelibrary.so
b: -exec shared someotherlibrary.so
q: -exec shared onemorelib.so
and then some command to load all those lines into the appropriate registers.
Is there a plugin that provides such a functionality?