Basic Commands
There are over 100 commands in Neovim, and thankfully, you don't need to know all of them to use the text editor—just a few basic commands are enough.
Copy and Paste in Neovim
Instead of using Ctrl + C and Ctrl + V, Neovim uses y and p for copying and pasting lines:
- yy - Copies an entire line in normal mode
- y3 - Copies 3 lines in normal mode
- y - Copies selected text in visual mode
Deleting Lines
- dd - Deletes a single line in normal mode
- d3 - Deletes 3 lines in normal mode
- d - Deletes selected text in visual mode
Undo and Redo
- u - Undo the last change
- Ctrl + r - Redo the undone change
Saving and Quitting
- :w - Save the current file
- :wq or ZZ - Save and quit
- :q - Quit (only if no unsaved changes)
- :q! or ZQ - Quit without saving changes
Searching
- /Linux - Search for 'Linux' (case-sensitive)
- n - Go to the next found 'Linux'
- N - Go to the previous 'Linux'
Back