Loading…
Warp is now open-source Learn more
Loading…
The keyboard shortcuts to copy, cut, and paste can be boiled down into three characters that utilize Vim-specific terminology.
Understanding these terms will help you recall the correct keyboard shortcut.
I deliberately use the phrase “conceptually similar to” because these actions are not one and the same. If you want to dive deeper into this explanation, scroll down to the section below titled “What Happens Under the Hood?”
Using arrow keys (or if you are an expert Vim user - h, j, k, and l) to move around in your vim file can take a long time.
Here are vim keyboard shortcuts for copying and cutting if you want to be even more efficient than the basic steps outlined above.
Vim terms are slightly different from their conceptual counterparts that we mentioned above because these actions by default do not interact with the OS clipboard. For example, you can't paste yanked text from Vim into a different application with CMD + V.
Yank, delete, and put interact with Vim's notion of “registers”, which are basically Vim -specific clipboards. Each register is named with a character, which you can use to interact with that register. For example, you might yank line 50 of the current file to register “a” and yank line 14 of the same file to register “b”, because you intend to paste both line 50 and line 14.
To learn more about vim registers, check out this Stack Overflow page.
This should be everything you need to get started to copy, cut and paste in Vi. If you didn’t find what you were looking for, it may be worth checking out the official vim docs.
Select and delete to the end of a file in Vim
Select all and copy, paste, or delete the contents
Copy (Yank), Paste (Put) and Cut (Delete) in Vim
Search forward, backward, case insensitive, and more
Toggle absolute and relative line numbers
Keyboard shortcuts and summary of how Vim tracks changes
Go to the end or beginning of a line in Vim
Variety of approaches to go to lines
Learn how to jump the top of the file in Vim, then navigate, search, highlight, and delete.
Quick reference for Vim's page up and down controls
The best answer depends on which mode you use