Here is a short practice exercise to help you get some hands-on experience with Neovim:
- Open a new file: Launch Neovim by typing
nvimin your terminal. Once Neovim is open, create a new file by typing:
This will open a new, empty buffer for you to work with.
- Insert some text: Press
ito enter Insert mode, and start typing some text. Type a few sentences about anything you like.
- Save the file: To save the file, press
Escto return to Normal mode, and then type:
This will save the current buffer to a file called
- Quit Neovim: To quit Neovim, type:
If you’ve made changes to the buffer and haven’t saved them, Neovim will warn you before quitting. If you want to discard your changes and quit without saving, type
- Reload the file: To reload the file you just saved, type:
This will reopen the file in a new buffer.
- Use a plugin: Neovim has many plugins available that can help you be more productive. One popular plugin is called
nerdtree, which provides a tree-based file explorer. To install it using
vim-plug, add the following line to your
After saving and re-sourcing your
init.vim file, you can install the plugin by running the
:PlugInstall command from within Neovim.
Once the plugin is installed, you can open the file explorer by typing:
This will open a new window showing the file tree. You can use the arrow keys to navigate and
Enter to open a file.
These are just a few examples of what you can do with Neovim. The more you use it, the more you’ll discover how powerful and flexible it can be.