/onedark.nvim

OneDark NeoVim theme written in Lua

Primary LanguageLuaMIT LicenseMIT

OneDark

A dark Neovim theme written in Lua. Includes extra themes for Kitty and Alacritty

Screen Shot 2021-05-23 at 3 48 41 PM

Screen Shot 2021-05-23 at 2 51 04 PM

✨ Features

  • supports the latest Neovim 0.5 features like TreeSitter and LSP
  • minimal inactive statusline (currently bugged)
  • vim terminal colors
  • darker background for sidebar-like windows
  • color configs for Kitty and Alacritty
  • lualine theme

Plugin Support

⚡️ Requirements

  • Neovim >= 0.5.0

📦 Installation

Install the theme with your preferred package manager:

vim-plug

Plug 'monsonjeremy/onedark.nvim'

packer

use 'monsonjeremy/onedark.nvim'

🚀 Usage

Enable the colorscheme:

" Vim Script
lua require('onedark').setup()
-- Lua
require('onedark').setup()

To enable the onedark theme for Lualine, simply specify it in your lualine settings:

require('lualine').setup {
  options = {
    theme = 'onedark'
    -- ... your lualine config
  }
}

To enable the onedark colorscheme for Lightline:

" Vim Script
let g:lightline = {'colorscheme': 'onedark'}

⚙️ Configuration

❗️ configuration needs to be set BEFORE loading the color scheme with colorscheme onedark

Option Default Description
commentStyle italic Highlight style for comments (check :help highlight-args for options)
keywordStyle italic Highlight style for keywords (check :help highlight-args for options)
functionStyle NONE Highlight style for functions (check :help highlight-args for options)
variableStyle NONE Highlight style for variables and identifiers (check :help highlight-args for options)
transparent false Enable this to disable setting the background color
hideInactiveStatusline false Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard StatusLine and LuaLine.
sidebars {} Set a darker background on sidebar-like windows. For example: {"qf", "vista_kind", "terminal", "packer"}
darkSidebar true Sidebar like windows like NvimTree get a darker background
darkFloat true Float windows like the lsp diagnostics windows get a darker background.
colors {} You can override specific color groups to use other groups or a hex color
-- Example config in Lua
require("onedark").setup({
  functionStyle = "italic",
  sidebars = {"qf", "vista_kind", "terminal", "packer"},

  -- Change the "hint" color to the "orange" color, and make the "error" color bright red
  colors = {hint = "orange", error = "#ff0000"}
})
" Example config in vimscript
lua << EOF
require("onedark").setup({
  functionStyle = "italic",
  sidebars = {"qf", "vista_kind", "terminal", "packer"},

  -- Change the "hint" color to the "orange" color, and make the "error" color bright red
  colors = {hint = "orange", error = "#ff0000"}
})

Making undercurls work properly in Tmux

To have undercurls show up and in color, add the following to your Tmux config file:

# Undercurl
set -g default-terminal "${TERM}"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'  # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'  # underscore colours - needs tmux-3.0

🍭 Extras

Extra color configs for Kitty, and Alacritty can be found in extras. To use them, refer to their respective documentation.

Screen Shot 2021-05-23 at 2 49 57 PM

Support

Buy Me A Coffee