PracticalVim Tip60 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 60: Grok Vim's Registers

Return to the top: <>

Addressing a Register

`"{register}`: specify a register

Vim's Terminology Versus the World

  • `"_d{motion}`: true deletion

References

The Unnamed Register ("")

References

The Yank Register ("0)

When we use the `y{motion}` command, the specified text is copied not only into the unnamed register but also into the yank register.

References

The Named Register ("a-"z)

When we address a named register with a lowercase letter, it _overwrites_ the specified register, whereas when we use an uppercase letter, it _appends_ to the specified register.

References

The Black Hole Register ("_)

References

The System Clipboard ("+) and Selection ("*) Registers

References

References

| Keystrokes | Buffer Contents | | `"+` | The X11 clipboard, used with cut, copy, and paste | | `"*` | The X11 primary, used with middle mouse button |

The Expression Register ("=)

References

More Registers

Read-only registers:

References

| Register | Contents | | `"%` | Name of the current file | | `"#` | Name of the alternate file | | `".` | Last inserted text | | `":` | Last Ex command | | `"/` | Last search pattern |

The `"/` register can be set explicitly using the `:let` command.

References

⚠️ **GitHub.com Fallback** ⚠️