An Introduction to Neovim Commands and Shortcuts

·

2 min read

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

  1. Normal mode: This is the default mode in Neovim, and is used for navigation and executing commands.

  2. Insert mode: This mode allows you to enter text into the file you're editing.

  3. 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

  1. i - switch to insert mode

  2. Esc - return to normal mode

  3. : - enter command mode

  4. w - save changes to the file

  5. q - quit Neovim

  6. u - undo the last change

  7. Ctrl + R - redo the last change

  8. yy - copy the current line

  9. dd - delete the current line

  10. p - paste the copied text after the current line

Visual Mode Commands

  1. v - switch to visual mode

  2. V - select entire lines

  3. Ctrl + V - select a block of text

  4. d - delete the selected text

  5. y - copy the selected text

Insert Mode Shortcuts

  1. Ctrl + W - delete the previous word

  2. Ctrl + U - delete everything to the left of the cursor

  3. Ctrl + O - return to normal mode temporarily

  4. Ctrl + R - insert the contents of a register

  5. Ctrl + T - indent the current line

  6. Ctrl + 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.

Did you find this article valuable?

Support Adi's blog by becoming a sponsor. Any amount is appreciated!