kanagawa.nvim
NeoVim dark colorscheme inspired by the colors of the famous painting by Katsushika Hokusai.
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.
🍨 Soothing pastel theme for (Neo)vim
🦊A highly customizable theme for vim and neovim with support for lsp, treesitter and a variety of plugins.
High Contrast & Vivid Color Scheme based on Monokai Pro
Gruvbox with Material Palette
Soho vibes for Neovim
Quick Overview
Kanagawa.nvim is a NeoVim colorscheme inspired by the famous painting "The Great Wave off Kanagawa". It aims to provide a pleasant and calming visual experience for developers, with a focus on readability and aesthetics. The theme is highly customizable and supports various plugins and language syntaxes.
Pros
- Beautiful and calming color palette inspired by traditional Japanese art
- Extensive support for various plugins and language syntaxes
- Highly customizable with options for different styles and preferences
- Actively maintained with regular updates and improvements
Cons
- May not suit everyone's taste, especially those who prefer brighter or more contrasting themes
- Requires some configuration to get the most out of its features
- Limited to NeoVim users, not available for other text editors or IDEs
Getting Started
To install and use Kanagawa.nvim, follow these steps:
- Install the colorscheme using your preferred plugin manager. For example, with Packer:
use "rebelot/kanagawa.nvim"
- Add the following to your NeoVim configuration file (e.g.,
init.lua
):
-- Set up the colorscheme
require('kanagawa').setup({
-- Add any custom configuration options here
})
-- Set the colorscheme
vim.cmd("colorscheme kanagawa")
- Restart NeoVim or source your configuration file to apply the changes.
For more advanced 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 color scheme variants (storm, night, day, moon)
- Better support for various plugins and languages
- More active development and frequent updates
Cons of tokyonight.nvim
- Less focus on a specific aesthetic (Kanagawa is inspired by traditional Japanese art)
- May require more configuration to achieve a desired look
- Potentially overwhelming number of options for some users
Code Comparison
tokyonight.nvim:
require("tokyonight").setup({
style = "storm",
transparent = true,
terminal_colors = true,
styles = {
comments = { italic = true },
keywords = { italic = true },
functions = {},
variables = {},
},
})
kanagawa.nvim:
require('kanagawa').setup({
undercurl = true,
commentStyle = { italic = true },
functionStyle = {},
keywordStyle = { italic = true},
statementStyle = { bold = true },
typeStyle = {},
variablebuiltinStyle = { italic = true},
specialReturn = true,
specialException = true,
transparent = false,
dimInactive = false,
globalStatus = false,
})
Both color schemes offer extensive customization options, but tokyonight.nvim provides more built-in variants and broader plugin support. Kanagawa.nvim focuses on a specific aesthetic inspired by traditional Japanese art, which may appeal to users looking for a unique and cohesive theme. The choice between the two ultimately depends on personal preference and specific needs for Neovim customization.
🍨 Soothing pastel theme for (Neo)vim
Pros of Catppuccin
- More extensive customization options, allowing users to fine-tune colors and styles
- Larger community and more frequent updates, potentially leading to better support and feature additions
- Offers multiple built-in color palettes (Latte, Frappe, Macchiato, Mocha) to suit different preferences
Cons of Catppuccin
- May require more configuration to achieve desired look, which can be overwhelming for some users
- Larger codebase and more complex structure, potentially leading to slower load times or conflicts
Code Comparison
Kanagawa configuration:
require('kanagawa').setup({
theme = "wave",
background = {
dark = "wave",
light = "lotus"
}
})
Catppuccin configuration:
require("catppuccin").setup({
flavour = "mocha",
background = {
light = "latte",
dark = "mocha",
},
integrations = {
cmp = true,
gitsigns = true,
telescope = true,
}
})
Both themes offer elegant and visually appealing color schemes for Neovim. Kanagawa provides a more focused, Japanese-inspired aesthetic with simpler configuration, while Catppuccin offers greater flexibility and customization options across multiple color palettes. The choice between them ultimately depends on personal preference and desired level of customization.
🦊A highly customizable theme for vim and neovim with support for lsp, treesitter and a variety of plugins.
Pros of Nightfox
- Multiple color schemes included (Nightfox, Dayfox, Dawnfox, etc.)
- Extensive plugin support with pre-configured integrations
- Highly customizable with a Lua API for fine-tuning colors
Cons of Nightfox
- May require more setup time due to numerous options
- Some users report occasional inconsistencies across different file types
Code Comparison
Kanagawa setup:
require('kanagawa').setup({
undercurl = true,
commentStyle = { italic = true },
functionStyle = {},
keywordStyle = { italic = true},
statementStyle = { bold = true },
typeStyle = {},
variablebuiltinStyle = { italic = true},
specialReturn = true,
specialException = true,
transparent = false,
dimInactive = false,
globalStatus = false,
terminalColors = true,
colors = {},
overrides = {},
theme = "default"
})
Nightfox setup:
require('nightfox').setup({
options = {
styles = {
comments = "italic",
keywords = "bold",
types = "italic,bold",
}
},
palettes = {},
specs = {},
groups = {},
})
Both color schemes offer extensive customization options, but Nightfox provides a more granular approach to styling different syntax elements.
High Contrast & Vivid Color Scheme based on Monokai Pro
Pros of Sonokai
- More color scheme variants (6 styles) compared to Kanagawa's 3
- Supports a wider range of applications beyond Neovim (Vim, terminals, etc.)
- Extensive documentation and configuration options
Cons of Sonokai
- Less focus on Neovim-specific features and plugins
- May require more manual configuration for optimal Neovim integration
- Slightly larger codebase, potentially impacting load times
Code Comparison
Sonokai color definition:
let s:palette = {
\ 'black': ['#181819', '237'],
\ 'bg0': ['#2c2e34', '235'],
\ 'bg1': ['#33353f', '236'],
\ 'bg2': ['#363944', '236'],
\ 'bg3': ['#3b3e48', '237'],
\ 'bg4': ['#414550', '237'],
}
Kanagawa color definition:
local colors = {
sumiInk0 = "#16161D",
sumiInk1 = "#181820",
sumiInk2 = "#1a1a22",
sumiInk3 = "#1F1F28",
sumiInk4 = "#2A2A37",
}
Both projects offer high-quality color schemes for Neovim, with Sonokai providing more variety and broader application support, while Kanagawa focuses on a cohesive Neovim-centric experience. The choice between them depends on personal preference and specific use cases.
Gruvbox with Material Palette
Pros of Gruvbox Material
- More extensive customization options, including contrast levels and palette variants
- Wider range of supported plugins and file types
- Longer development history, potentially leading to better stability
Cons of Gruvbox Material
- May require more configuration to achieve desired look
- Less focus on modern, minimalist aesthetics
- Potentially heavier resource usage due to more extensive feature set
Code Comparison
Gruvbox Material configuration:
vim.g.gruvbox_material_background = 'medium'
vim.g.gruvbox_material_better_performance = 1
vim.cmd('colorscheme gruvbox-material')
Kanagawa configuration:
require('kanagawa').setup({
theme = "wave",
background = {
dark = "dragon",
light = "lotus"
}
})
vim.cmd("colorscheme kanagawa")
Both color schemes offer easy setup, but Kanagawa provides a more streamlined configuration process with its setup function. Gruvbox Material relies more on global variables for customization, which may be less intuitive for some users. However, this approach also allows for more granular control over various aspects of the theme.
Soho vibes for Neovim
Pros of Rose Pine
- More extensive theme variants (main, moon, and dawn)
- Broader ecosystem support beyond Neovim (e.g., terminal emulators, IDEs)
- Active community with frequent updates and contributions
Cons of Rose Pine
- Less customization options for individual syntax elements
- May have a steeper learning curve for theme configuration
Code Comparison
Rose Pine:
require('rose-pine').setup({
variant = 'moon',
dark_variant = 'main',
bold_vert_split = false,
dim_nc_background = false,
disable_background = false,
disable_float_background = false,
disable_italics = false,
})
Kanagawa:
require('kanagawa').setup({
undercurl = true,
commentStyle = { italic = true },
functionStyle = {},
keywordStyle = { italic = true},
statementStyle = { bold = true },
typeStyle = {},
transparent = false,
dimInactive = false,
terminalColors = true,
})
Both Rose Pine and Kanagawa offer beautiful color schemes for Neovim, with Rose Pine providing more variants and broader ecosystem support. Kanagawa, on the other hand, offers more granular customization options for syntax elements. The code examples demonstrate the different configuration approaches, with Rose Pine focusing on variant selection and global settings, while Kanagawa allows for more detailed syntax styling.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
ð KANAGAWA.nvim ð
NeoVim dark colorscheme inspired by the colors of the famous painting by Katsushika Hokusai.
Features
- Extensive support for
TreeSitter
syntax highlighting, and many popular plugins - Compilation to lua byte code for super fast startup times
Installation
Download with your favorite package manager.
use "rebelot/kanagawa.nvim"
Requirements
- neovim latest
- truecolor terminal support
- undercurl terminal support (optional)
Usage
As simple as writing (pasting)
colorscheme kanagawa
vim.cmd("colorscheme kanagawa")
Configuration
There is no need to call setup if you are ok with the defaults.
-- Default options:
require('kanagawa').setup({
compile = false, -- enable compiling the colorscheme
undercurl = true, -- enable undercurls
commentStyle = { italic = true },
functionStyle = {},
keywordStyle = { italic = true},
statementStyle = { bold = true },
typeStyle = {},
transparent = false, -- do not set background color
dimInactive = false, -- dim inactive window `:h hl-NormalNC`
terminalColors = true, -- define vim.g.terminal_color_{0,17}
colors = { -- add/modify theme and palette colors
palette = {},
theme = { wave = {}, lotus = {}, dragon = {}, all = {} },
},
overrides = function(colors) -- add/modify highlights
return {}
end,
theme = "wave", -- Load "wave" theme when 'background' option is not set
background = { -- map the value of 'background' option to a theme
dark = "wave", -- try "dragon" !
light = "lotus"
},
})
-- setup must be called before loading
vim.cmd("colorscheme kanagawa")
NOTE 1: If you enable compilation, make sure to run :KanagawaCompile
command every time you make changes to your config.
" 1. Modify your config
" 2. Restart nvim
" 3. Run this command:
:KanagawaCompile
NOTE 2: Kanagawa adjusts to the value of some options. Make sure that the options 'laststatus'
and 'cmdheight'
are set before calling setup
.
Themes
Kanagawa comes in three variants:
wave
the default heart-warming theme,dragon
for those late-night sessionslotus
for when you're out in the open.
Themes can be changed in three ways:
- Setting
config.theme
to the desired theme. Note thatvim.o.background
must be unset. - Using the
background
option: Any change to the value ofvim.o.background
will select the theme mapped byconfig.background
. Usevim.o.background = ""
to unset this option. - Loading the colorscheme directly with:
orvim.cmd("colorscheme kanagawa-wave") vim.cmd("colorscheme kanagawa-dragon") vim.cmd("colorscheme kanagawa-lotus")
require("kanagawa").load("wave")
Customization
In kanagawa, there are two kinds of colors: PaletteColors
and ThemeColors
;
PaletteColors
are defined directly as RGB Hex strings, and have arbitrary names
that recall their actual color. Conversely, ThemeColors
are named and grouped semantically
on the basis of their actual function.
In short, a palette
defines all the available colors, while a theme
maps the PaletteColors
to specific ThemeColors
and the same palette color may be assigned to multiple theme colors.
You can change both theme or palette colors using config.colors
.
All the palette color names can be found here,
while their usage by each theme can be found here.
require('kanagawa').setup({
...,
colors = {
palette = {
-- change all usages of these colors
sumiInk0 = "#000000",
fujiWhite = "#FFFFFF",
},
theme = {
-- change specific usages for a certain theme, or for all of them
wave = {
ui = {
float = {
bg = "none",
},
},
},
dragon = {
syn = {
parameter = "yellow",
},
},
all = {
ui = {
bg_gutter = "none"
}
}
}
},
...
})
You can also conveniently add/modify hlgroups
using the config.overrides
option.
Supported keywords are the same for :h nvim_set_hl
{val}
parameter.
require('kanagawa').setup({
...,
overrides = function(colors)
return {
-- Assign a static color to strings
String = { fg = colors.palette.carpYellow, italic = true },
-- theme colors will update dynamically when you change theme!
SomePluginHl = { fg = colors.theme.syn.type, bold = true },
}
end,
...
})
Common customizations
Remove gutter background
Remove the background of LineNr
, {Sign,Fold}Column
and friends
colors = {
theme = {
all = {
ui = {
bg_gutter = "none"
}
}
}
}
Transparent Floating Windows
This will make floating windows look nicer with default borders.
overrides = function(colors)
local theme = colors.theme
return {
NormalFloat = { bg = "none" },
FloatBorder = { bg = "none" },
FloatTitle = { bg = "none" },
-- Save an hlgroup with dark background and dimmed foreground
-- so that you can use it where your still want darker windows.
-- E.g.: autocmd TermOpen * setlocal winhighlight=Normal:NormalDark
NormalDark = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m3 },
-- Popular plugins that open floats will link to NormalFloat by default;
-- set their background accordingly if you wish to keep them dark and borderless
LazyNormal = { bg = theme.ui.bg_m3, fg = theme.ui.fg_dim },
MasonNormal = { bg = theme.ui.bg_m3, fg = theme.ui.fg_dim },
}
end,
If you'd like to keep the floating windows darker, but you're unhappy with how borders are rendered, consider using characters that are drawn at the edges of the box:
{ "ð½", "â", "ð¾", "â", "ð¿", "â", "ð¼", "â" }
Borderless Telescope
Block-like modern Telescope UI
overrides = function(colors)
local theme = colors.theme
return {
TelescopeTitle = { fg = theme.ui.special, bold = true },
TelescopePromptNormal = { bg = theme.ui.bg_p1 },
TelescopePromptBorder = { fg = theme.ui.bg_p1, bg = theme.ui.bg_p1 },
TelescopeResultsNormal = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m1 },
TelescopeResultsBorder = { fg = theme.ui.bg_m1, bg = theme.ui.bg_m1 },
TelescopePreviewNormal = { bg = theme.ui.bg_dim },
TelescopePreviewBorder = { bg = theme.ui.bg_dim, fg = theme.ui.bg_dim },
}
end,
Dark completion (popup) menu
More uniform colors for the popup menu.
overrides = function(colors)
local theme = colors.theme
return {
Pmenu = { fg = theme.ui.shade0, bg = theme.ui.bg_p1 }, -- add `blend = vim.o.pumblend` to enable transparency
PmenuSel = { fg = "NONE", bg = theme.ui.bg_p2 },
PmenuSbar = { bg = theme.ui.bg_m1 },
PmenuThumb = { bg = theme.ui.bg_p2 },
}
end,
Integration
Get palette and theme colors
-- Get the colors for the current theme
local colors = require("kanagawa.colors").setup()
local palette_colors = colors.palette
local theme_colors = colors.theme
-- Get the colors for a specific theme
local wave_colors = require("kanagawa.colors").setup({ theme = 'wave' })
Terminal integration
The following example provides a snippet to automatically change the theme for the Kitty terminal emulator.
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "kanagawa",
callback = function()
if vim.o.background == "light" then
vim.fn.system("kitty +kitten themes Kanagawa_light")
elseif vim.o.background == "dark" then
vim.fn.system("kitty +kitten themes Kanagawa_dragon")
else
vim.fn.system("kitty +kitten themes Kanagawa")
end
end,
})
Color palette
Name | Hex | Usage | |
---|---|---|---|
fujiWhite | #DCD7BA | Default foreground | |
oldWhite | #C8C093 | Dark foreground (statuslines) | |
sumiInk0 | #16161D | Dark background (statuslines and floating windows) | |
sumiInk1 | #1F1F28 | Default background | |
sumiInk2 | #2A2A37 | Lighter background (colorcolumn, folds) | |
sumiInk3 | #363646 | Lighter background (cursorline) | |
sumiInk4 | #54546D | Darker foreground (line numbers, fold column, non-text characters), float borders | |
waveBlue1 | #223249 | Popup background, visual selection background | |
waveBlue2 | #2D4F67 | Popup selection background, search background | |
winterGreen | #2B3328 | Diff Add (background) | |
winterYellow | #49443C | Diff Change (background) | |
winterRed | #43242B | Diff Deleted (background) | |
winterBlue | #252535 | Diff Line (background) | |
autumnGreen | #76946A | Git Add | |
autumnRed | #C34043 | Git Delete | |
autumnYellow | #DCA561 | Git Change | |
samuraiRed | #E82424 | Diagnostic Error | |
roninYellow | #FF9E3B | Diagnostic Warning | |
waveAqua1 | #6A9589 | Diagnostic Info | |
dragonBlue | #658594 | Diagnostic Hint | |
fujiGray | #727169 | Comments | |
springViolet1 | #938AA9 | Light foreground | |
oniViolet | #957FB8 | Statements and Keywords | |
crystalBlue | #7E9CD8 | Functions and Titles | |
springViolet2 | #9CABCA | Brackets and punctuation | |
springBlue | #7FB4CA | Specials and builtin functions | |
lightBlue | #A3D4D5 | Not used | |
waveAqua2 | #7AA89F | Types | |
springGreen | #98BB6C | Strings | |
boatYellow1 | #938056 | Not used | |
boatYellow2 | #C0A36E | Operators, RegEx | |
carpYellow | #E6C384 | Identifiers | |
sakuraPink | #D27E99 | Numbers | |
waveRed | #E46876 | Standout specials 1 (builtin variables) | |
peachRed | #FF5D62 | Standout specials 2 (exception handling, return) | |
surimiOrange | #FFA066 | Constants, imports, booleans | |
katanaGray | #717C7C | Deprecated |
Accessibility
The colors maintain a 4.5:1
contrast ratio, complying with WCAG 2.1 | Level AA.
Extras
- alacritty
- Alfred
- base16
- broot
- emacs, doom emacs
- fish
- foot
- iTerm
- kitty
- mintty
- pywal
- sway
- wezterm
- Windows Terminal
- Xresources
- tmTheme (bat, delta and lazygit)
- JSON compatible with many terminals Check Gogh for the list of supported terminals.
- ð Bonus! You win a tiny python scriptð to extract color palettes ð¨ from any image! ð¥³
Acknowledgements
Donate
Buy me coffee and support my work ;)
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.
🍨 Soothing pastel theme for (Neo)vim
🦊A highly customizable theme for vim and neovim with support for lsp, treesitter and a variety of plugins.
High Contrast & Vivid Color Scheme based on Monokai Pro
Gruvbox with Material Palette
Soho vibes for Neovim
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot