Convert Figma logo to code with AI

navarasu logoonedark.nvim

One dark and light colorscheme for neovim >= 0.5.0 written in lua based on Atom's One Dark and Light theme. Additionally, it comes with 5 color variant styles

1,530
155
1,530
65

Top Related Projects

🏙 A clean, dark Neovim theme written in Lua, with support for lsp, treesitter and lots of plugins. Includes additional themes for Kitty, Alacritty, iTerm and Fish.

🦊A highly customizable theme for vim and neovim with support for lsp, treesitter and a variety of plugins.

5,343

🍨 Soothing pastel theme for (Neo)vim

GitHub's Neovim themes

1,627

High Contrast & Vivid Color Scheme based on Monokai Pro

Quick Overview

OneDark.nvim is a dark color scheme for Neovim, inspired by the Atom One Dark theme. It provides a modern and visually appealing look for your Neovim editor, with support for various plugins and language-specific highlighting.

Pros

  • Highly customizable with various style options and color overrides
  • Supports a wide range of plugins and language-specific syntax highlighting
  • Offers different styles (dark, darker, cool, deep, warm, warmer)
  • Easy to install and configure

Cons

  • May require additional setup for some plugins or language-specific features
  • Limited to Neovim users (not compatible with regular Vim)
  • Some users may find the default colors too saturated or intense

Getting Started

To install OneDark.nvim using a plugin manager like Packer:

use 'navarasu/onedark.nvim'

Add the following to your Neovim configuration file (e.g., init.lua):

require('onedark').setup {
    style = 'dark'
}
require('onedark').load()

You can customize the theme by modifying the setup options:

require('onedark').setup {
    style = 'darker',
    transparent = true,
    term_colors = true,
    ending_tildes = false,
    cmp_itemkind_reverse = false,
    -- Override colors
    colors = {
        bright_orange = "#ff8800",
    },
    -- Override highlight groups
    highlights = {
        TSKeyword = {fg = '$green'},
    }
}

For more detailed configuration options and customization, refer to the project's README and documentation on GitHub.

Competitor Comparisons

🏙 A clean, dark Neovim theme written in Lua, with support for lsp, treesitter and lots of plugins. Includes additional themes for Kitty, Alacritty, iTerm and Fish.

Pros of tokyonight.nvim

  • More customization options, including light and dark variants
  • Better support for various plugins and language-specific highlighting
  • Active development with frequent updates and improvements

Cons of tokyonight.nvim

  • Slightly more complex configuration due to additional options
  • May require more system resources due to extensive feature set

Code Comparison

onedark.nvim:

require('onedark').setup {
    style = 'dark',
    transparent = true,
    term_colors = true,
}

tokyonight.nvim:

require("tokyonight").setup({
    style = "storm",
    light_style = "day",
    transparent = true,
    terminal_colors = true,
    styles = {
        comments = { italic = true },
        keywords = { italic = true },
        functions = {},
        variables = {},
    },
})

Both color schemes offer easy setup and configuration, but tokyonight.nvim provides more granular control over styles and elements. While onedark.nvim focuses on simplicity and a classic look, tokyonight.nvim offers a wider range of customization options and better support for various plugins and languages. However, this increased flexibility may come at the cost of slightly more complex configuration and potentially higher resource usage.

🦊A highly customizable theme for vim and neovim with support for lsp, treesitter and a variety of plugins.

Pros of Nightfox

  • Offers multiple color schemes (Nightfox, Dayfox, Dawnfox, etc.) in one package
  • Provides extensive customization options for colors and styles
  • Includes built-in support for various plugins and integrations

Cons of Nightfox

  • May have a steeper learning curve due to its extensive configuration options
  • Potentially higher resource usage due to multiple color schemes and customization features

Code Comparison

Onedark configuration:

require('onedark').setup {
    style = 'dark',
    transparent = true,
    term_colors = true,
    ending_tildes = false,
}

Nightfox configuration:

require('nightfox').setup {
    fox = "nightfox",
    transparent = true,
    styles = {
        comments = "italic",
        keywords = "bold",
        functions = "italic,bold",
    },
}

Both color schemes offer easy setup and configuration, but Nightfox provides more granular control over styles and multiple color scheme options within a single package. Onedark focuses on a single, polished theme with simpler configuration options. The choice between them depends on whether you prefer a straightforward setup or more extensive customization capabilities.

5,343

🍨 Soothing pastel theme for (Neo)vim

Pros of Catppuccin

  • Offers multiple color palettes (Latte, Frappe, Macchiato, Mocha) for different preferences
  • Extensive plugin support with pre-configured integrations
  • Active community and frequent updates

Cons of Catppuccin

  • May require more configuration to achieve desired look
  • Larger codebase, potentially impacting load times
  • Some users might find the pastel-based themes less versatile

Code Comparison

Onedark:

require('onedark').setup {
    style = 'dark',
    transparent = true,
    term_colors = true,
    ending_tildes = false,
}

Catppuccin:

require("catppuccin").setup({
    flavour = "mocha",
    background = { light = "latte", dark = "mocha" },
    transparent_background = false,
    term_colors = true,
})

Both themes offer similar configuration options, but Catppuccin provides more granular control over color palettes and integrations. Onedark focuses on a single cohesive theme with variations, while Catppuccin offers distinct flavors catering to different tastes.

GitHub's Neovim themes

Pros of github-nvim-theme

  • Offers a wider variety of color schemes, including light and dark variants of GitHub themes
  • Provides better integration with GitHub's visual style, which may be preferred by some users
  • Includes support for more plugins and language-specific highlighting

Cons of github-nvim-theme

  • May have a steeper learning curve due to more configuration options
  • Could be considered less visually appealing for users who prefer a more minimalist or non-GitHub-specific look
  • Potentially slower performance due to more complex color calculations

Code Comparison

onedark.nvim:

require('onedark').setup {
    style = 'dark',
    transparent = true,
    term_colors = true,
    ending_tildes = false,
}

github-nvim-theme:

require("github-theme").setup({
    theme_style = "dark",
    function_style = "italic",
    sidebars = {"qf", "vista_kind", "terminal", "packer"},
    dark_sidebar = true,
})

Both themes offer easy setup, but github-nvim-theme provides more granular control over various UI elements and styles.

1,627

High Contrast & Vivid Color Scheme based on Monokai Pro

Pros of Sonokai

  • Offers multiple color scheme variants (default, atlantis, andromeda, shusia, maia, espresso)
  • Includes support for a wider range of plugins and file types
  • Provides better customization options for fine-tuning colors

Cons of Sonokai

  • May have a steeper learning curve due to more configuration options
  • Could be considered less "out-of-the-box" ready compared to OneDark.nvim

Code Comparison

Sonokai configuration:

vim.g.sonokai_style = 'andromeda'
vim.g.sonokai_better_performance = 1
vim.cmd[[colorscheme sonokai]]

OneDark.nvim configuration:

require('onedark').setup {
    style = 'darker'
}
require('onedark').load()

Both color schemes offer easy setup, but Sonokai provides more built-in style options, while OneDark.nvim focuses on a single theme with customization through its setup function.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Dark and Light Themes for neovim >= 0.5 based on Atom One Dark & Atom One Light theme written in lua with TreeSitter syntax highlight.

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

For latest TreeSitter syntax highlight, upgraded to Neovim 0.8.0 or later built with tree-sitter 0.20.3+

Features

  • 8 theme styles (One Dark + 5 variants) and (One Light + 1 variant)
  • Supporting multiple plugins with hand picked proper colors
  • Customize Colors, Highlights and Code style of the theme as you like (Refer Customization)
  • 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

Installation

Install via your favourite package manager

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

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

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
    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 = {
    ["@keyword"] = {fg = '$green'},
    ["@string"] = {fg = '$bright_orange', bg = '#00ff00', fmt = 'bold'},
    ["@function"] = {fg = '#0000ff', sp = '$cyan', fmt = 'underline,italic'},
    ["@function.builtin"] = {fg = '#0059ff'}
  }
}

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

Reference

Contributing

Pull requests are welcome 🎉👍.

License

MIT