Neovim (aka Nvim) is a radical refactor of Vim. It aims to take Vim, improve the code, and add more features. They are mostly compatible but have slightly different defaults.
Neovim is a text editor, but it can be configured with plugins to be closer to an IDE. Plugins are a big subject we are not going to cover in this tutorial, we are aiming to get a minimal working setup with zero bloat.
Getting the current stable version of Neovim
Everything in this tutorial is current for Neovim version v0.12, the latest stable release. You can see which versions are available for your distribution at
pkgs.org, or download the
Neovim AppImage directly from the releases page. It also works on Windows Subsystem for Linux.
How to configure Neovim without using plugins
If you want a great text editor out of the box then you will find yourself banging your head against the wall with Neovim. Many of the factory default settings are weird, and many features are not enabled. In this article, I will show you how to make Neovim awesome without resorting to using any plugins.
All the settings I am going to suggest are built right into Neovim. Modern Neovim is configured with Lua, so you create a config file at ~/.config/nvim/init.lua and paste the settings into it. (If you prefer, you can still use the older Vimscript init.vim; the settings translate directly.)
If you want to know what a current setting is you can type:
:set [name of variable]?
For example, :set linebreak? will show you the current line break setting, either linebreak or nolinebreak.
Change the escape key to jk
Maybe the most important key in Neovim is the escape key, you use it constantly to move from insert mode to normal mode. The physical position of the escape key on modern keyboards is not easy to reach, I strongly suggest you change escape to be jk, this is very easy to use for touch typing:
vim.keymap.set('i', 'jk', '<Esc>')
vim.keymap.set('t', 'jk', '<C-\\><C-n>')
The other popular choice is the Caps Lock key. It can be remapped to have two functions: tap to escape, hold for ctrl. On Linux you can do this with keyd, and on macOS with Karabiner-Elements.
Give your document window a title
Neovim uses your terminal to run. By default, depending on what terminal you use, your Neovim terminal window may not be given a title. If you have different windows open with different documents then you have no way of knowing which to select in your windows’ manager. We can put a stop to this:
vim.opt.title = true
Tabs vs spaces. Use spaces
It is 2026, and we have all collectively agreed to have the tab key create spaces, anything else would have been insane. How many spaces each tab key creates is a personal preference, but I am going for 2. Neovim also has an option that controls indentation, so we should use the same value for that:
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
Soft wrapping, it’s complicated
Ideally, when we edit a document we want to view it with a line length of about 80-100 characters, anything more makes it hard to scan.
If hard line breaks are used the document can’t be wrapped flexibly by other software using screen size and resolution. Neovim soft wraps to the width of the window by default, and it cuts words as it wraps. To make the best of this we can set Neovim to not split words when soft wrapping, but split on words:
vim.opt.linebreak = true
I suggest you keep an open terminal to the right and Neovim to the left, then you should experience a deep zen-like feeling of minimalism. You never need to leave this sacred safe space again.
- This problem is a good use case for a zen mode plugin
Use the system clipboard
On some systems, Neovim will not have support for the system clipboard available. It relies on using an external package to integrate.
To test your system, inside Neovim move to a line with some text on and press "+yy. The + sign means use the system clipboard. Try to ctrl-v it into some other text editor. If it doesn’t work you are most likely missing the external clipboard package that Neovim needs. If you are using Wayland it is probably the wl-clipboard package. For example, on Debian/Ubuntu:
sudo apt install wl-clipboard
or on RHEL/Rocky Linux/CentOS/Fedora:
sudo dnf install wl-clipboard
If you have problems, consult the Neovim manual using :h clipboard, it lists all the external clipboard tools that can be used.
The idea of having a separate + register for the system clipboard is so you don’t constantly overwrite your system clipboard with every yank and deletion. For example, if you copy a link from the browser then delete a line to make room for it, the clipboard will be empty. I don’t find this a problem and don’t want to have to type "+ in front of commands, if you agree then you can have the system + register be used by default:
vim.opt.clipboard = 'unnamedplus'
Enable the spell checker
Neovim has a great spell checker built-in, but you would never know it unless you stumbled across it. To turn it on, set the language, and create a shortcut to toggle it on and off:
vim.opt.spell = true
vim.opt.spelllang = 'en_us'
-- toggle spell in normal mode
vim.keymap.set('n', '<F6>', ':set invspell<CR>')
-- toggle spell in insert mode
vim.keymap.set('i', '<F6>', '<C-O>:set invspell<CR>')
Check the spelling documentation on how to use it.
Markdown fenced language syntax highlighting
If you edit documents for programming, then you are probably using Markdown. Neovim has built-in syntax highlighting for most languages. A great feature of Markdown is the ability to embed code into your document using ‘code fencing’. With Neovim’s built-in treesitter support, syntax highlighting inside fenced code blocks now works automatically. You don’t need to configure anything.
Neovim can run as a service for other editors
One of the big features that Neovim has that Vim lacks is the ability to communicate with other software via an API. This means that you can use Neovim as the engine for other editors. The most interesting use for this that I have found is the vscode-neovim extension for Visual Studio Code.
vscode-neovim runs Neovim in the background and pipes all your keyboard commands through it. You get all the functionality of Neovim added to Visual Studio Code! Integrating Code can be a blessing or a curse depending on how easily you are distracted. The main benefit of just using Neovim is to stay focused and accept any limitations, otherwise, you can get sucked down the configuration and new feature rabbit hole and never return.
If you really want an IDE experience then using vscode-neovim is a far better option than spending weeks trying to turn Neovim into Code using extensions like
coc.vim.
Bonus: Visual Studio Code dark color scheme
The default colors for syntax highlighting in Neovim are not to everyone’s taste. I think Visual Studio Code dark theme’s colors are a lot better. Luckily it has been converted for Vim/Neovim in the form of vim-code-dark and vscode.nvim.
As I am not getting into plugins in this article, using this colour scheme can just be a single configuration file
codedark.vim that you can copy into ~/.config/nvim/colors.
Add the following to activate it:
vim.cmd('colorscheme codedark')
It includes syntax highlighting for many languages and works great in conjunction with Markdown fenced language syntax highlighting. It looks best in Neovim if you install nvim-treesitter.
vim-code-dark vs vscode dark+ visual comparison
While not identical, it is close enough (select view image to see 1080p):
Conclusion
Neovim is an amazing text editor, but out of the box, it has many strange settings. It is a mistake to resort to 3rd party extensions until you know you can’t fix the problem using built-in features. Using the settings in this guide we have:
- Changed the escape key to make it much easier to use
- Given our document windows titles so we can easily find them using our windows manager
- Changed to use spaces rather than tabs
- Learned about soft wrapping and altered the settings for the best possible experience
- Enabled the system clipboard and spell checker
- Enabled syntax highlighting for code blocks inside markdown files
- Swapped the default color scheme for an emulated Visual Studio Code dark theme.