navarasu/onedark.nvim

github github
treesitter-colorschemes plugin
star 180
stars
alert-circle 11
open issues
users 5
subscribers
git-branch 28
forks
CREATED

2021-05-09

UPDATED

3 days ago

packer

require('packer').startup(function()
  use 'navarasu/onedark.nvim'
end)

paq

require "paq" { 
  'navarasu/onedark.nvim'
}

A Dark Theme for neovim >= 0.5 based on Atom One Dark Theme written in lua with TreeSitter syntax highlight. Additionally, it comes with 5 more color variant styles

For Vim / Neovim < 0.5, prefer joshdick/onedark.vim

Features

  • 6 styles (default one dark + 5 color variants)
  • Changing the style without exiting Neovim (using shortcut key <leader>cs. If you want to change or disable this mapping see toggle style)
  • Supported mulitple plugins with hand picked proper colors

Plugins Supported

Styles

Dark

colorscheme onedark

Default - Default one dark theme based on Atom One Dark Theme

Darker

let g:onedark_style = 'darker'
colorscheme onedark

Cool

let g:onedark_style = 'cool'
colorscheme onedark

Deep

let g:onedark_style = 'deep'
colorscheme onedark

Warm

let g:onedark_style = 'warm'
colorscheme onedark

Warmer

let g:onedark_style = 'warmer'
colorscheme onedark

Installation

Install via your favourite package manager

" Using Vim-Plug
Plug 'navarasu/onedark.nvim'
-- Using Packer
use 'navarasu/onedark.nvim'

Install manually

git clone https://github.com/navarasu/onedark.nvim ~/.config/nvim
nvim +PackerSync

Requirements

Usage

Enable the colorscheme:

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

To Enable the onedark theme for Lualine, specify theme as onedark:

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

Toggle style

By pressing <leader>cs, we can switch the style without exiting Neovim.

If you want to change this mapping:

vim.g.onedark_toggle_style_keymap = '<space>tc'

If you want to disable this mapping completely:

vim.g.onedark_toggle_style_keymap = '<nop>'

Configuration

Important: you need to add the configs before changing colorscheme

Onedark options

Variable name Default value Description
onedark_style 'dark' change style variant of one dark
onedark_transparent_background false enable transparent background
onedark_italic_comment true enable italic comments
onedark_toggle_style_keymap '<leader>cs' set toggle style keymap (see toggle style)
onedark_disable_terminal_colors false disable terminal colors
onedark_diagnostics_undercurl true use curly underline (undercurl) instead of standard underline for diagnostics
onedark_darker_diagnostics true show diagnostics using a darker color
onedark_hide_ending_tildes false hide end of buffer tildes

Configure onedark.nvim using vimscript:

let g:onedark_style = 'darker'
let g:<onedark_option> = 'value'
colorscheme onedark

When using vimscript to configure onedark settings be sure to use v:true and v:false to set booleand values!

let g:onedark_italic_comment = v:true        " don't use 0 or 1

Configure onedark.nvim using lua:

vim.g.onedark_style = 'deep'
vim.g.onedark_italic_comment = false
vim.g.<onedark_option> = 'value'
require('onedark').setup()

Reference

Contributing

Pull requests are welcome 🎉👍.

License

MIT