Skip to content
プロジェクト

概要

Neovim向けのOne Dark/One Lightテーマと、VS Code、Ghostty、kitty、Alacritty、WezTerm、iTerm2、Windows Terminal、tmux向けの対応テーマです。6種類のスタイルがあり、それぞれにライト版があります。

開発ツール

この数値の測り方

できること

  • 12 theme styles: 6 dark styles (dark, darker, cool, deep, warm, warmer), each with a light version (Refer Themes)
  • Supporting multiple plugins with hand picked proper colors
  • Customize Colors, Highlights and Code style of the theme as you like (Refer Customization)
  • Matching themes for Ghostty, kitty, Alacritty, WezTerm, iTerm2, Windows Terminal, tmux, fzf, lazygit and delta (Refer Extras)

計測したスター増加

24時間
0
7日間
+2
15日間
+4
1か月
+8

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

One Dark Classic

Dark and Light themes for Neovim >= 0.9, based on Atom One Dark & Atom One Light, written in Lua with TreeSitter syntax highlighting.

Also available for Ghostty, kitty, Alacritty, WezTerm, iTerm2, Windows Terminal, tmux, fzf, lazygit and delta, in every style. See Extras.

Requirements

  • Neovim 0.9.0+ - For modern TreeSitter captures, LSP semantic tokens, and full feature support
  • For Neovim 0.5-0.8, use v0.1.0
  • For Vim / Neovim < 0.5, prefer joshdick/onedark.vim

Features

  • 12 theme styles: 6 dark styles (dark, darker, cool, deep, warm, warmer), each with a light version (Refer Themes)
  • Supporting multiple plugins with hand picked proper colors
  • Customize Colors, Highlights and Code style of the theme as you like (Refer Customization)
  • Matching themes for Ghostty, kitty, Alacritty, WezTerm, iTerm2, Windows Terminal, tmux, fzf, lazygit and delta (Refer Extras)
  • Toggle the theme style without exiting Neovim using toggle_style_key (Refer Config)

Themes

Onedark - dark Onedark - darker

Onedark - cool Onedark - deep

Onedark - warm Onedark - warmer

Light versions

Every style has a light version. It's used when Neovim's background is light (:set background=light, or a light terminal that Neovim detects), so you keep one style name for both.

Onedark - dark, light background Onedark - darker, light background

Onedark - cool, light background Onedark - deep, light background

Onedark - warm, light background Onedark - warmer, light background

Installation

For Neovim 0.9+ (Latest Version)

Install the latest version from master:

-- Using vim.pack
vim.pack.add({
        "https://github.com/navarasu/onedark.nvim",
        })
require('onedark').setup {
    style = 'darker'
}
require('onedark').load()
-- Using Lazy
{
  "navarasu/onedark.nvim",
  priority = 1000, -- make sure to load this before all the other start plugins
  config = function()
    require('onedark').setup {
      style = 'darker'
    }
    require('onedark').load()
  end
}
" Using Vim-Plug
Plug 'navarasu/onedark.nvim'
-- Using Packer
use 'navarasu/onedark.nvim'

For Neovim 0.5-0.8 (Legacy Version)

Pin to v0.1.0 for compatibility with older Neovim:

-- Using Lazy
{
  "navarasu/onedark.nvim",
  version = "v0.1.0", -- Pin to legacy version
  priority = 1000,
  config = function()
    require('onedark').setup {
      style = 'darker'
    }
    require('onedark').load()
  end
}
" Using Vim-Plug
Plug 'navarasu/onedark.nvim', { 'tag': 'v0.1.0' }
-- Using Packer
use { 'navarasu/onedark.nvim', tag = 'v0.1.0' }

Configuration

Enable theme

-- Lua
require('onedark').load()
" Vim
colorscheme onedark

Change default style

-- Lua
require('onedark').setup {
    style = 'darker'
}
require('onedark').load()
" Vim
let g:onedark_config = {
    \ 'style': 'darker',
\}
colorscheme onedark

Options: dark, darker, cool, deep, warm, warmer, light

Each style follows Neovim's background:

Style Dark background Light background
dark One Dark One Light (same as style = 'light')
darker One step darker One step dimmer: soft grey
cool Blue tint White with a blue tint
deep Deeper, bluish Dimmer, bluish
warm Neutral grey Cream paper
warmer Darker neutral grey Deeper cream paper

style = 'light' always uses the light background. To switch at any time, run :set background=light or :set background=dark; your style stays the same.

Changed in v1.1: before v1.1, a light background always loaded the light theme, whatever the style. If you used darker, cool, deep, warm or warmer with a light background and want that look back, set style = 'light' (light only) or style = 'dark' (One Dark, with One Light on a light background).

Default Configuration

-- Lua
require('onedark').setup  {
    -- Main options --
    style = 'dark', -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light'
    transparent = false,  -- Show/hide background
    term_colors = true, -- Change terminal color as per the selected theme style
    ending_tildes = false, -- Show the end-of-buffer tildes. By default they are hidden
    cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu

    -- toggle theme style ---
    toggle_style_key = nil, -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "<leader>ts"
    toggle_style_list = {'dark', 'darker', 'cool', 'deep', 'warm', 'warmer', 'light'}, -- List of styles to toggle between

    -- Change code style ---
    -- Options are italic, bold, underline, none
    -- You can configure multiple style with comma separated, For e.g., keywords = 'italic,bold'
    code_style = {
        comments = 'italic',
        keywords = 'none',
        functions = 'none',
        strings = 'none',
        variables = 'none'
    },

    -- Lualine options --
    lualine = {
        transparent = false, -- lualine center bar transparency
    },

    -- Custom Highlights --
    colors = {}, -- Override default colors
    theme_colors = {}, -- Override colors for one style only, e.g. { darker = { bg0 = "#1a1a1a" } }
    highlights = {}, -- Override highlight groups

    -- Plugins Config --
    diagnostics = {
        darker = true, -- darker colors for diagnostic
        undercurl = true,   -- use undercurl instead of underline for diagnostics
        background = true,    -- use background color for virtual text
    },
}

Vimscript configuration

Onedark can be configured also with Vimscript, using the global dictionary g:onedark_config. NOTE: when setting boolean values use v:true and v:false instead of 0 and 1

Example:

let g:onedark_config = {
  \ 'style': 'deep',
  \ 'toggle_style_key': '<leader>ts',
  \ 'ending_tildes': v:true,
  \ 'diagnostics': {
    \ 'darker': v:false,
    \ 'background': v:false,
  \ },
\ }
colorscheme onedark

Customization

Example custom colors and Highlights config

require('onedark').setup {
  colors = {
    bright_orange = "#ff8800",    -- define a new color
    green = '#00ffaa',            -- redefine an existing color
  },
  highlights = {
    ["@lsp.type.keyword"] = { fg = "$green" },
    ["@lsp.type.property"] = {fg = '$bright_orange', bg = '#00ff00', fmt = 'bold'},
    ["@lsp.type.function"] =  {fg = '#0000ff', sp = '$cyan', fmt = 'underline,italic'},
    ["@lsp.type.method"] = { link = "@function" },
  -- To add language specific config
    ["@lsp.type.variable.go"] = { fg = "none" },
  }
}

To change a colour for one style only, use theme_colors. Other styles keep their defaults.

require('onedark').setup {
  style = 'darker',
  theme_colors = {
    darker = { bg0 = '#1a1a1a' },  -- only the darker style gets this background
    light  = { fg = '#202020' },
  },
}

Note that TreeSitter keywords have been changed after neovim version 0.8 and onwards. TS prefix is trimmed and lowercase words should be used separated with '.'

The old way before neovim 0.8 looks like this. For all keywords see this file from line 133 to 257

require('onedark').setup {
  colors = {
    bright_orange = "#ff8800",    -- define a new color
    green = '#00ffaa',            -- redefine an existing color
  },
  highlights = {
    TSKeyword = {fg = '$green'},
    TSString = {fg = '$bright_orange', bg = '#00ff00', fmt = 'bold'},
    TSFunction = {fg = '#0000ff', sp = '$cyan', fmt = 'underline,italic'},
    TSFuncBuiltin = {fg = '#0059ff'}
  }
}

Plugins Configuration

Enable lualine

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

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

Plugins Supported

Extras

Matching themes for your terminal and tools, for every style and its light version, are in extras/. Each file is named onedark_<style>, and light versions onedark_light_<style>. The examples below use dark: replace it with darker, cool, deep, warm, warmer, light, or a light version such as light_deep.

VS Code

Install One Dark Classic from the VS Code Marketplace or Open VSX, then pick a theme with Preferences: Color Theme. It has all 12 themes: One Dark Classic, One Darker, One Dark Cool, Deep, Warm and Warmer, and One Light Classic, Darker, Cool, Deep, Warm and Warmer.

Ghostty
mkdir -p ~/.config/ghostty/themes
curl -fsSL -o ~/.config/ghostty/themes/onedark_dark https://raw.githubusercontent.com/navarasu/onedark.nvim/master/extras/ghostty/onedark_dark

Then add theme = onedark_dark to ~/.config/ghostty/config.

kitty
mkdir -p ~/.config/kitty
curl -fsSL -o ~/.config/kitty/onedark_dark.conf https://raw.githubusercontent.com/navarasu/onedark.nvim/master/extras/kitty/onedark_dark.conf

Then add include onedark_dark.conf to ~/.config/kitty/kitty.conf.

Alacritty
mkdir -p ~/.config/alacritty/themes
curl -fsSL -o ~/.config/alacritty/themes/onedark_dark.toml https://raw.githubusercontent.com/navarasu/onedark.nvim/master/extras/alacritty/onedark_dark.toml

Then add this to ~/.config/alacritty/alacritty.toml (Alacritty 0.14+; on older versions put import at the top level):

[general]
import = ["~/.config/alacritty/themes/onedark_dark.toml"]

Alacritty reloads the config as soon as you save.

WezTerm
mkdir -p ~/.config/wezterm/colors
curl -fsSL -o ~/.config/wezterm/colors/onedark_dark.toml https://raw.githubusercontent.com/navarasu/onedark.nvim/master/extras/wezterm/onedark_dark.toml

Then set config.color_scheme = "OneDark Dark" in ~/.wezterm.lua (the name is OneDark Darker, OneDark Cool and so on for the other styles).

iTerm2

Download onedark_dark.itermcolors, then in iTerm2 open Settings → Profiles → Colors → Color Presets → Import, and pick the file.

Windows Terminal

Open Settings → Open JSON file, and paste the contents of onedark_dark.json into the schemes list. Then set "colorScheme": "OneDark Dark" in your profile.

tmux
mkdir -p ~/.config/tmux
curl -fsSL -o ~/.config/tmux/onedark_dark.tmux https://raw.githubusercontent.com/navarasu/onedark.nvim/master/extras/tmux/onedark_dark.tmux
echo 'source-file ~/.config/tmux/onedark_dark.tmux' >> ~/.tmux.conf
tmux source-file ~/.tmux.conf

Only colours are set; your status line layout is kept.

fzf
mkdir -p ~/.config/fzf
curl -fsSL -o ~/.config/fzf/onedark_dark.sh https://raw.githubusercontent.com/navarasu/onedark.nvim/master/extras/fzf/onedark_dark.sh
echo 'source ~/.config/fzf/onedark_dark.sh' >> ~/.zshrc   # or ~/.bashrc
lazygit

Copy the gui.theme block from onedark_dark.yml into lazygit's config.yml (run lazygit --print-config-dir to find it).

delta
curl -fsSL -o ~/.config/delta-onedark_dark.gitconfig https://raw.githubusercontent.com/navarasu/onedark.nvim/master/extras/delta/onedark_dark.gitconfig
git config --global --add include.path ~/.config/delta-onedark_dark.gitconfig
git config --global delta.features onedark-dark

The files are generated from the theme's palette, so they always match the editor. After changing lua/onedark/palette.lua, run nvim -l scripts/extras.lua.

Reference

Contributing

Pull requests are welcome 🎉👍.

License

MIT


Made by Navarasu · navarasu.com

関連プロジェクトを探す

読み込み中…