Wednesday, July 29, 2009

Types of Registers

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 "/

Tuesday, July 28, 2009

Insert Register Contents

If you're in insert mode and would like to insert the contents of a given register without going into normal mode, you can hit ctrl-r and then input the desired register. Between typing ctrl-r and the second character, a '"' will be displayed to indicate that you are expected to enter a register.