Skip to content

Instantly share code, notes, and snippets.

@innyso
Last active April 11, 2020 12:42
Show Gist options
  • Save innyso/6d02d58a3618fc0691f4cd451c07228b to your computer and use it in GitHub Desktop.
Save innyso/6d02d58a3618fc0691f4cd451c07228b to your computer and use it in GitHub Desktop.
#vim #register

vim has something called registers which is like spaces that allow us to store text information and allow us to access it using its identifier

default registers

  • + and * system clipboard
  • " unnamed register where everything last yank/delete will be there

numbered registers

  • vim automatic populate "0 to "9 where "0 is the latest yank/delete and the rest are the last 9 yank/delete

read only registry

  • ". last insert text
  • ": last executed command
  • "% current file path

To see the registers

# see everythin in register
:reg

# see content of register b and c
:reg b c

named registers

# yank current line to registry b
"byy

# delete current line and save to b
"bdd

# yank current line and append to register b
"Byy

References:

https://www.brianstorti.com/vim-registers/

https://medium.com/vim-drops/vim-registers-the-powerful-native-clipboard-19b1c97891bd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment