Color Theme in Neovim

Shaik Zahid
3 min readFeb 6, 2023

--

Iconic Colorschemes for Neovim

When it comes to choosing a Colorscheme for your IDE, the topic becomes very subjective as one may like or dislike your preferences. So I will list some colorschemes which may suit your taste and the installation process is similar to the one which is shown in this article.

I will be using the standard tokyonight theme. It was developed by none other than Folke Lemaitre. This guy is like Newton for Neovim Community. All the major plugins I’ve seen are developed by him. I will be installing the Night version of tokyonight theme.

Night version of tokyonight colorscheme

Installation

  • Add ‘folke/tokyonight.nvim’ to your plugins.lua file inside lua directory.
-- Plugins.lua

return {

-- Bufferline
{
'akinsho/bufferline.nvim',
dependencies = 'nvim-tree/nvim-web-devicons'
},

-- Colorscheme
{
'folke/tokyonight.nvim',
},

}
  • We don’t need to create a new file here, We can set the colorscheme in our options.lua file. Add this code to the end of the file.
-- Options.lua
vim.cmd[[colorscheme tokyonight-night]] -- Add this line at the end of the file
  • [Optional] If the action above does not work, clear the code in your options.lua file and insert this one.
local opt = vim.opt


opt.autowrite = true -- Enable auto write
opt.clipboard = "unnamedplus" -- Sync with system clipboard
opt.completeopt = "menu,menuone,noselect"
opt.conceallevel = 3 -- Hide * markup for bold and italic
opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs
opt.formatoptions = "jcroqlnt" -- tcqj
opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case
opt.inccommand = "nosplit" -- preview incremental substitute
opt.incsearch = true
opt.laststatus = 0
opt.list = true -- Show some invisible characters (tabs...
opt.mouse = "a" -- Enable mouse mode
opt.number = true -- Print line number
opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup
opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 5 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
opt.shiftround = true -- Round indent
opt.shiftwidth = 4 -- Size of an indent
opt.shortmess:append { W = true, I = true, c = true }
opt.showmode = false -- Dont show mode since we have a statusline
opt.sidescrolloff = 8 -- Columns of context
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.spelllang = { "en" }
opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
opt.tabstop = 4 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support
opt.timeoutlen = 150
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.wildmode = "longest:full,full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap

-- Fix markdown indentation settings
vim.g.markdown_recommended_style = 0

vim.cmd[[colorscheme tokyonight-night]]

Neovim From Scratch

  • If you want a complete installation and configuration of Neovim from Scratch, then you can head over to my NEOVIM SERIES.
  • This series is updated regularly, with updates and inclusion of newer plugins which improves the wholesome IDE experience of Neovim.

--

--