There was some mention of the special registers in Vim in the comments on my last post. Here's a list of all available registers in Vim (copied directly from the docs). For more info on what these registers do, please see :help registers.
There are nine types of registers:
1. The unnamed register ""
2. 10 numbered registers "0 to "9
3. The small delete register "-
4. 26 named registers "a to "z or "A to "Z
5. four read-only registers ":, "., "% and "#
6. the expression register "=
7. The selection and drop registers "*, "+ and "~
8. The black hole register "_
9. Last search pattern register "/
Showing posts with label registers. Show all posts
Showing posts with label registers. Show all posts
Wednesday, July 29, 2009
Friday, November 16, 2007
Macro Registers
Most Vim users know about macros and find them useful; however, until recently, I didn't realize they are actually stored in the same registers we all know and love. For example, you create a new macro by pressing `qa'. You type in a series of commands that you would like to repeat, end the macro, done. But wait, you made a mistake. Well, you can easily edit the macro stored in `qa'. I typically issue a :new to open a new window, move my cursor to that window and then "ap. The contents of the macro are printed to the window. From there, you can edit the macro as needed and then yank the macro back in to the desired register by executing something like 0"ay$. Once yanked, the new macro will execute as you would expect it would.
Subscribe to:
Posts (Atom)