Minimal NeoVim Theme

Neovim is in my opinion a great text editor. I use it for pretty much everything having to do with editing text. It is (in their own words) “hyperextensible”, which has spawned a multitude of plugins, themes, etc.

I generally don’t like to install lots of plugins and large bloated themes. Both plugins and themes do have their place, but my computers are slow and I also like to understand what happens under the hood (to the extent it is possible and feasible). For these reasons I tend to prefer configuring things myself in as few lines as possible. I will however confess that I am a recovering user of mason and all his friends.

When it comes to colorschemes in NeoVim I generally like the “default” colorscheme. My only problem is that it doesn’t highlight very much and that the line numbers is too bright. The best way to fix this (in my opinion) is to just add more highlighting in the spirit of the default theme (feel free to disagree).

As previously said I think plugins have their place. One of the plugins I currently think is useful (for my usecase) is telescope. If you are not a software developer working on medium to large codebases it is probably not necessary. Though it might sound strange it is also very useful for making your own neovim themes. You can easily browse all highlight groups available in neovim by simply doing:

:Telescope highlights

This is useful if you know what you are looking for. If you don’t know what you are looking for, but know that whatever is under your cursor should have a different color, then you can simply do:

:Inspect

Then it will tell you the most immediate highlight group for the symbol under your cursor, as well as what it is linked to (and you don’t need to install telescope either).

Another thing I am not very fond of is when a theme (and fonts) only works properly in gvim or in a fancy terminal. I want my theme to work in my TTY’s as well. Hence I try to limit myself to using standard colors. If you don’t know how to configure highlight groups this way, see my example below:

vim.cmd.colorscheme("default")
vim.api.nvim_set_hl(0, "Comment",    { ctermfg=2 })
vim.api.nvim_set_hl(0, "LineNr",     { ctermfg=8 })
vim.api.nvim_set_hl(0, "MatchParen", { ctermbg=8 })
vim.api.nvim_set_hl(0, "Delimiter",  { ctermfg=6 })
vim.api.nvim_set_hl(0, "Constant",   { ctermfg=6 })
vim.api.nvim_set_hl(0, "Operator",   { ctermfg=8, bold=true })
vim.api.nvim_set_hl(0, "Underlined", { ctermfg=6 }) -- VimWiki

Find colors here (“Xterm Number” is the interesting part)