Plus: a command to clear all registers at once! You’re probably feeling very confident to cut ( ), copy (yank ) and paste ( ) on vim, and now it's time to take this operations to another level using registers! x y p In fact, registers are already being used when you perform the operations mentioned before. Registers is everywhere on vim! When you yank, delete, paste, cut, when you edit text, when you type a command in normal mode, it’s all being registered. Vim has 9 types of registers with different characteristics ( ‘ ’), but we’re not going too deep, we’re gonna focus on the basic registers, the you can check typing :help registers named registers. What is Vim Registers? You can think of registers as a functionality on vim that exists to store information. Vim uses it registering commands you enter, files you open, text you input, etc. What vim does is to save all this data on a file while you're working ( ). .viminfo relax, you’ll never need to touch this file Vim allows you to use this functionality, this , to store different texts on different addresses like: powerful clipboard "a — Hello, "b — World "c — Again! …and even allows you to append more text on a register that is already fullfilled: + = "a — Hello, to all the people "a — Hello, to all the people …and then it’s there, saved on your clipboard, to paste it the where and when you want to. How to use it: From all the different types of registers, we’re gonna focus on using the , from to . You can use this 26 letters as an address to save text on your clipboard, and later call the specific address you want to paste. named registers a z What you're used to do: To copy (yank) a line: yy To delete a line: dd To paste a line copied: p Things are almost the same with registers, you’ll just need to set the register you’re gonna use before typing the command. How to save things: You just need to type + the letter you picked as address for that specific text you’ll saving, and then type the command you're gonna use. " Let’s say you want to copy line 1 and store it on register , you'll go this line and type: d "dyy the line 1 was saved at register d Now, you’d like to save line 3 on register , and delete line 5 but saving it on register : a g Go to line 3 and type "byy Go to line 5 and type "gdd line 3 was stored on register b, and line 5 was deleted but saved on register g (You can always use the command _:registers_ to preview your clipboard) How to paste things: The same way you record a register is the way you’ll paste a register. If you want to paste line 1 (stored on ), and then paste the deleted line 5 (stored on ), type , and . d g "dp "gp you can paste it to other files / buffers too Appending text to a fillfilled register: It’s easy to append more text to a named register that already has text on it. To do that you’re gonna use the uppercase letter when performing the operation. Let’s say you want to delete line 6 but appending the text on register where you already has text, and after, you want to paste this new register to the other file. b b Go to line 6 and type "Bdd Go to the other file and type "bp Done! You’ve learned the basic usage of registers. It’s enough to give you more flexibility, boost your productivity, and you have opened new doors. Now you can hit ‘ ' and learn more! :help registers Special Trick: Clear all registers! Vim carry on registers to other sessions, it saves all registers on file, as mentioned before. .viminfo If you don’t want to get a messy clipboard, or you just want to start fresh at some sessions, there’s a script you can add on your file that creates this command , and it will always be on hands for whenever you feel like wiping all registers. .vimrc :WipeReg Open your file and paste this command in one single line: .vimrc command! WipeReg for i in range(34,122) | silent! call setreg(nr2char(i), []) | endfor Type whenever you feel like cleaning up the table! :WipeReg (This trick was posted on Stack Overflow, thanks laktak ) Footnotes: If you have any doubts or tips I’d appreciate to know and discuss it on the comments section. Do you have any other vim tips and want to publish it here? Send me and email at ‘vimdrops AT pm DOT me’ with your medium username and I’ll invite you as a writer! As English is not my first language, I apologize for errors. Corrections are welcome at ‘vimdrops AT pm DOT me’. Originally published at Vim Drops April 16, 2018.