Neovim is a popular text editor with a number of advanced features and customizable options. In order to make the most of Neovim, it's important to understand the different modes it offers, as well as the various commands and shortcuts that are available.
Modes in Neovim
Normal mode: This is the default mode in Neovim, and is used for navigation and executing commands.
Insert mode: This mode allows you to enter text into the file you're editing.
Visual mode: This mode enables you to select text and perform various actions on it, such as copying or deleting.
The different modes in Neovim can be thought of as separate tools, each with its own set of commands and shortcuts. Below, we'll explore the various commands and shortcuts available in each mode, to help you make the most of Neovim.
Normal Mode Commands
i
- switch to insert modeEsc
- return to normal mode:
- enter command modew
- save changes to the fileq
- quit Neovimu
- undo the last changeCtrl + R
- redo the last changeyy
- copy the current linedd
- delete the current linep
- paste the copied text after the current line
Visual Mode Commands
v
- switch to visual modeV
- select entire linesCtrl + V
- select a block of textd
- delete the selected texty
- copy the selected text
Insert Mode Shortcuts
Ctrl + W
- delete the previous wordCtrl + U
- delete everything to the left of the cursorCtrl + O
- return to normal mode temporarilyCtrl + R
- insert the contents of a registerCtrl + T
- indent the current lineCtrl + D
- un-indent the current line
With these commands and shortcuts, you'll be able to navigate, edit, and save text files in Neovim with ease. Remember, these are just a few of the many features available in Neovim, and as you become more familiar with the text editor, you can explore all the advanced functionality that it has to offer.