Giter Site home page Giter Site logo

rebelot / kanagawa.nvim Goto Github PK

View Code? Open in Web Editor NEW
4.1K 12.0 171.0 4.35 MB

NeoVim dark colorscheme inspired by the colors of the famous painting by Katsushika Hokusai.

License: MIT License

Lua 71.68% Python 1.29% Shell 0.97% Vim Script 0.11% Emacs Lisp 25.94%
neovim lsp lua neovim-colorscheme neovim-theme nvim syntax-highlighting terminal-colors theme tree-sitter-highlight

kanagawa.nvim's Introduction

๐ŸŒŠ KANAGAWA.nvim ๐ŸŒŠ

NeoVim dark colorscheme inspired by the colors of the famous painting by Katsushika Hokusai.

Preview

W3C

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 sessions
  • lotus for when you're out in the open.

Themes can be changed in three ways:

  • Setting config.theme to the desired theme. Note that vim.o.background must be unset.
  • Using the background option: Any change to the value of vim.o.background will select the theme mapped by config.background. Use vim.o.background = "" to unset this option.
  • Loading the colorscheme directly with:
    vim.cmd("colorscheme kanagawa-wave")
    vim.cmd("colorscheme kanagawa-dragon")
    vim.cmd("colorscheme kanagawa-lotus")
    or
    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

Acknowledgements

Donate

Buy me coffee and support my work ;)

Donate

kanagawa.nvim's People

Contributors

3719e04 avatar akriese avatar catgoose avatar champignoom avatar dinotheextinct avatar fbearoff avatar hatter-long avatar jasonrhansen avatar kting28 avatar ludopinelli avatar mhanberg avatar mluna-again avatar mrfiregem avatar mrtnvgr avatar neved4 avatar nkhlmn avatar notmde avatar nrademacher avatar otavioschwanck avatar p1scescom avatar paul-hansen avatar rebelot avatar rkuester avatar rochalaj avatar sanka047 avatar sboysel avatar sonphantrung avatar tomdeneire avatar wieerd avatar williamboman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kanagawa.nvim's Issues

Python Treesitter doesn't highlight properly

So I've been mainly trying out the dark theme with python. And the syntax highlighting doesn't seem to be working properly.
I'm on Neovim nightly and have the latest Treesitter installed.
image

Here is an example of the same snipper inside of Pycharm as a comparison.
image

So I was wondering about if I have something wrong, or how I might add the missing colours? Are there specific colours that should be applied?

Bold and italics don't work in newest commit

Italics and bold no longer work after the latest commit. I have already made the updates to my config (I'm on v0.7.0):

function M.setup()
    local ok, kanagawa = pcall(require, 'kanagawa')
    if not ok then
        log.error('kanagawa not available', 'Config')
        return false
    end

    vim.g.kanagawa_lualine_bold = true

    kanagawa.setup({
        undercurl = true,
        commentStyle = { italic = true },
        functionStyle = { bold = true },
        keywordStyle = { bold = true },
        statementStyle = { bold = true },
        typeStyle = { bold = true },
        variablebuiltinStyle = { bold = true },
        specialReturn = true,
        specialException = true,
        transparent = false,
        dimInactive = false, -- while shade is broken
        globalStatus = true,
        colors = {},
        overrides = {},
    })

    vim.cmd('colorscheme kanagawa')
end

Here's what it currently looks like:
Screen Shot 2022-06-10 at 9 58 11 PM

Prior to the latest commit (I pinned this commit):
Screen Shot 2022-06-10 at 10 00 06 PM

Transparency of some fields

I would like to know if it is possible to make some additional parts transparent, such as the command line and the diagnostic sign column. I just think is more consistent if these two fields can be transparent. I am attaching an image to illustrate the current behavior I would like to change.
Very nice theme by the way.

Screenshot_20211229_195150
.

Override NvimTree background color

the color changes when I change the cursor position from NvimTree to the editor and the top of the NvimTree does not change color

override.nvim.tree.background.mp4

I am trying to get something like this:
screenshot

Too much fujiWhite everywhere

Really love these colors but just trying to figure out why I am getting way too much fujiWhite everywhere in my code and the easiest way to make it render more colors based on the built-ins for scala but also applies to all of my java files. Using basic config as follows:

โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…use({
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…"rebelot/kanagawa.nvim",โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…configโ‹…=โ‹…function()โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…require("kanagawa").setup({โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…undercurlโ‹…=โ‹…true,โ‹…--โ‹…enableโ‹…undercurlsโ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…commentStyleโ‹…=โ‹…"italic",โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…functionStyleโ‹…=โ‹…"NONE",โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…keywordStyleโ‹…=โ‹…"italic",โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…statementStyleโ‹…=โ‹…"bold",โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…typeStyleโ‹…=โ‹…"NONE",โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…variablebuiltinStyleโ‹…=โ‹…"italic",โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…specialReturnโ‹…=โ‹…true,โ‹…--โ‹…specialโ‹…highlightโ‹…forโ‹…theโ‹…returnโ‹…keywordโ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…specialExceptionโ‹…=โ‹…true,โ‹…--โ‹…specialโ‹…highlightโ‹…forโ‹…exceptionโ‹…handlingโ‹…keywordsโ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…transparentโ‹…=โ‹…false,โ‹…--โ‹…doโ‹…notโ‹…setโ‹…backgroundโ‹…colorโ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…dimInactiveโ‹…=โ‹…true,โ‹…--โ‹…dimโ‹…inactiveโ‹…regionsโ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…colorsโ‹…=โ‹…{},โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…overridesโ‹…=โ‹…{},โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…})โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…end,โ†ด
  โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…โ‹…})

image

Some characters won't color properly

Hi. I tried this lovely theme recently and after applying throws me an error:

Error detected while processing /home/mauridevs/.local/share/nvim/site/pack/packer/start/kanag awa.nvim/colors/kanagawa.vim: line 1: W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name W18: Invalid character in group name Press ENTER or type command to continue

Tried other themes and this issue doesn't happen.

I noticed that the colors won't apply in the numbers and the ~ (empty line char) still appears as blue (see image below).
2022-10-17_18-07

Config:
Nvim 0.7.2
PopOS 22.04

Returns `palette_colors` from kanagwa.colors.setup()

Thanks for the beautiful scheme.

Recently I tried to override and set some highlight groups based on this theme colors palette, and found that I couldn't
get proper code completion from the lua LSP (which sometimes caused misspelling as I has to write them manually),
apparently the cause was since the kanagawa.colors module returns table from vim.tbl_extend, not the actual
palette table, my workaround for this is to assign the final result to palette_colors.

Previously, the completion came from what I wrote for the c variable, although it is unrelated
20220407_203340_full

After, completion came from the actual palette_colors
20220407_203438_full

diff --git a/lua/kanagawa/colors.lua b/lua/kanagawa/colors.lua
index baf2fde..9facef9 100644
--- a/lua/kanagawa/colors.lua
+++ b/lua/kanagawa/colors.lua
@@ -67,7 +67,8 @@ function M.setup(config)
     local colors = vim.tbl_extend("force", palette_colors, config.colors)
     local theme = require("kanagawa.themes")[config.theme](colors)
     theme = vim.tbl_extend("force", theme, config.colors)
-    return vim.tbl_extend("force", theme, colors)
+    palette_colors = vim.tbl_extend("force", theme, colors)
+    return palette_colors
 end
 
 return M

Sure, this has nothing to do with the color scheme, but it's a good DX.

More color options between `bg_dark` and `bg`

At the moment, the difference between NormalFloat and Normal is very large. Is there any intention of adding more color options between the two (in the same way we have a lighter gradient of background colors)? Personally, I'd like to see a couple more colors that aren't as high contrast when creating floats (having more options will let users customize certain floats to have different highlights).

Lualine Support

I have been using your colorscheme for sometime now, but couldn't get to activate the lualine support. I have put the lualine theme option in auto , but the statusline colors seems to muted. Is that it is supposed to be.

Missing WinBar highlight group

May you add WinBar highlight groups?

My suggestion:

hi WinBar cterm=NONE gui=NONE guibg=#16161d
hi WinBarNC guifg=#727169 guibg=#16161d

In python: the comment out codes have the same color !!

Hi, thank you for making this great theme. In python, the comment codes have the same color as the uncomment ones (comment out), which makes it difficult to read/write note above python code. I'm using the last version of neovim.
kanagawa

Vscode

I have used this color scheme for awhile in neovim but have recently switch to using vscode with vim plugin, any plans to bring this to vscode?

Background issue on fidget.nvim

Recently I've started using j-hui/fidget.nvim. The background of the UI is always pitch black, not the blueey color that is the default background.

Example:
image

Unable to define custom colors while using defaults

Hi, I'm trying to change the default background color, while also using some of the original defaults to customize the existing hl-groups. Here's a minimal config to show what I mean:

local default_colors = require("kanagawa.colors")

local colors = {
	sumiInk1 = "#272727", -- new background color
}

local overrides = {
	Search = { bg = default_colors.surimiOrange }, -- customize search highlight color
}

require("kanagawa").setup({
	overrides = overrides,
	colors = colors,
})

vim.cmd("colorscheme kanagawa")

The customizations in overrides are applied, but the new background color in colors is not applied. However, this issue is fixed when I define my own colors as such, without reference to default_colors:

local colors = {
	sumiInk1 = "#272727", 
	surimiOrange = "#FFA066",
}

local overrides = {
	Search = { bg = colors.surimiOrange },
}

It seems that reference to default_colors is overriding my customizations in colors. Is there another way to do this that I'm missing?

Thank you for creating this colorscheme! I'm really loving it.

Kanagawa light mode

Hi, I am currently enjoying the dark colorscheme, just wondering if there are any plans regarding a light mode for those sunny days?

Seachbox support

Hello, thank you very much for this amazing colorscheme! Would there be the possibility of supporting searchbox.nvim? Currently, seems a little broken:/

image

tmux colors?

First of all, thank you so much for this beautiful theme. It is funny when i am picking a scheme; i never really know what im looking for but i just KNOW when i've found the one.

I couldn't help notice you also had a tmux theme which fitted nicely together with kanagawa, if you have time at some point i would love to use it as well.

Neogit Highlight Issues

Love the colorscheme by the way!

By default, Neogit's highlight groups are difficult to read and have colors that don't mesh well with theme when a hunk is under the cursor:
Screen Shot 2022-07-29 at 2 00 36 PM

Seems Neogit highlight groups are commented out by default as well.

I have some overrides that modify the theme to look like this:
Not selected:
Not Selected

Selected:
Screen Shot 2022-07-29 at 2 06 35 PM

Config:

require("kanagawa").setup({
    transparent = true,
    dim_inactive = true,
    globalStatus = true,
    overrides = {
        NeogitHunkHeader = { bg = colors.diff.text },
        NeogitHunkHeaderHighlight = { fg = colors.git.changed, bg = colors.diff.text },
        NeogitDiffContextHighlight = { bg = colors.diff.change },
        NeogitDiffDeleteHighlight = { fg = colors.git.removed, bg = colors.diff.delete },
        NeogitDiffAddHighlight = { fg = colors.git.added, bg = colors.diff.add },
    },
})

1.) Wondering if someone else can replicate the colors I'm seeing by default
2.) Wondering if a PR would be welcome to set the defaults if the weird colors can be replicated from defaults?

Beautiful colorscheme, with a few issues

I have been using kanagawa for about a week now, and I'm really enjoying it, however, I have two things that make me want to move to a different colorscheme:

  • the bold orange color for true/false makes me think I have a diagnostic warning in my code every time I see it
  • the background color of floating windows (seen for example in pop-up diagnostics) is almost indistinguishable from the regular background color, so it is too difficult to see where it ends

Great work on this!

W18: Invalid character in group name error in older Neovim version

Hey, thanks for a great colorscheme. Recently updated my plugins and started getting W18: Invalid character in group name errors. I'm on Neovim 0.7.2 and found this is due the capture group names in 631e0aa where @ was added in a later version. My :h group-name:

image

Not sure if you want to update any documentation, maybe tag the previous working commit fc2e308, or have another solution so just reporting it for now. Using { 'rebelot/kanagawa.nvim', commit = 'fc2e308' } in packer config works for me.

how to get color palette ?

previously i use something like this local colors = require("kanagawa.colors") to get the color palette table.
And i can use like this colors.oniViolet to get specific color, previously no this is problem, but after updating the plugin i always get the null.

how i get color palette for latest version ?

btw i really like this colorscheme.
i'm sorry for my english.
cheers...(UwU)

Thank you for being the fastest.

This is not an issue. I just want to thank you this amazing colorscheme.

kanagawa is by far the fastest full featured nvim colorscheme I have ever use. Sub 2ms loading time. 2nd fastest is tokyonight, around 3ms slower

I don't know what you did under the hood. I hope it stay that way forever.

Thank you!

Table of color pallete

Thanks for creating this nice colorscheme!

Would you mind by any chance adding a table of your color palette somewhere, probably to README? So that users can easily customize for example their statusline colors using kanagawa's palette.
The table would contain color names (samuraiRed, etc.), their corresponding HEX values, and actual color images, defined in lua/kanagawa/colors.lua. I imagine something like this.

configure highlighting of Literal Strings

Hi!

I'm currently implementing a grammar with LuLPEG and that grammar is defined inside a 1st-Level Literal String. Literal Strings are now highlighted by kanagawa.vim as you can see in the screenshot. Unfortunately, the whole block got repainted if I move the cursor a line up or down, which is very annoying for me. I tried to redefine the colors and highlighting groups as described for this color scheme , but I hadn't any luck.
So, what is the correct configuration for no highlighting of Literal Strings?

image

If you want to try that by your yourself, this is the code I used in the screenshot:

local mail_pat = [=[
    groups            <- (group (%s* ([,;] %s*)+ group)*) -> {}
    group             <- (
                            {:name: <phrase> :} %s* <addr>                  /
                            {:name: <uq_phrase> :} %s* "<" <addr_spec> ">"  /
                            <addr> %s* {:name: <phrase> :}                  /
                            "<" <addr_spec> ">" %s* {:name: <uq_phrase> :}  /
                            <addr>                                          /
                            {:name: <phrase> :}
                          ) -> {}
    uq_phrase          <- <uq_atom> (%s+ <uq_atom>)*
    uq_atom            <- [^<>,; ]+
    phrase            <- <word> ([%s.]+ <word>)* /  <quoted_string>
    word              <- <atom> ! <domain_addr>
    atom              <- [^] %c()<>@,;:\".[]+
    quoted_string     <- '"' ([^"\%nl] / "\" .)*  '"'
    addr              <- <addr_spec> / "<" <addr_spec> ">"
    addr_spec         <- {:addr: <addr_chars> <domain_addr> :}
    domain_addr       <- "@" <addr_chars>
    addr_chars        <- [_%a%d][-._%a%d]*
  ]=]

Bufferline background changed after dc51a23

dc51a23 made the background of bufferline white for me, whereas previously it was black. Before and after below:

2022-06-13T17:36:02,537462404+01:00

2022-06-13T17:35:28,074178445+01:00

I don't have a big config for Kanagawa so idk what to change:

vim.opt.laststatus = 3
vim.opt.fillchars:append({
  horiz = 'โ”',
  horizup = 'โ”ป',
  horizdown = 'โ”ณ',
  vert = 'โ”ƒ',
  vertleft = 'โ”จ',
  vertright = 'โ”ฃ',
  verthoriz = 'โ•‹',
})
require('kanagawa').setup({ globalStatus = true, ... })
vim.cmd('colorscheme kanagawa')

Cmp Highlights groups

May you add colors for Cmp Highlight groups:

CmpItemKindMethod
CmpItemKindFunction
CmpItemKindConstructor
CmpItemKindField
CmpItemKindClass
CmpItemKindInterface
CmpItemKindModule
CmpItemKindProperty
CmpItemKindValue
CmpItemKindEnum
CmpItemKindKeyword
CmpItemKindSnippet
CmpItemKindFile
CmpItemKindEnumMember
CmpItemKindConstant
CmpItemStruct
CmpItemKindStruct
CmpItemKindTypeParameter

Colors in Cmp-Popup make that menu nicer and allows selecting needed variant faster (at least for me).

It looks like this:
image

Error in nvim-dap-ui

An error occurs in the nvim-dap-ui plugin when running PackerSync.
packer.nvim: Error running config for nvim-dap-ui: ...packer/start/nvim-dap-ui/lua/dapui/config/highlights.lua:74: bad argument #2 to 'format' (number expected, got nil).
The problem disappears after commenting these highlights:

-- DapUIStop = { link = "Error" }, --guifg=#F70067"
-- DapUIUnavailable = { link = "Comment" }, --guifg=#424242"

Vimdoc color issues when conceal is off

Hello! Thank you for this incredible colorscheme. I'm absolutely loving it so far. I noticed something today which is maybe a bit niche and I've honestly never really thought about the highlight groups that are at play here, but in my own plugin I am often editing my *.txt help file. When conceallevel is set to 0 things like * or | are pretty impossible to see in various places. I'll give you a couple examples:

* in headings

2021-12-24 21 52 45

Notice it's not visible at all unless you are on top of it

Usages of |

2021-12-24 21 54 08

Notice here that they are really hard to see by are actually around every command in that list. You also notice in that shot that the "`" is incredible hard to see as well

Let me know if there is anything else I can provide for this. Again, wonderful colorscheme. I'm really really enjoying it so far. Here is a little beauty shot:

Screenshot 2021-12-23 at 21 52 09

WinBar highlight group overwrite works randomly

I found overriding WinBar highlighting group works randomly.
Even I override WinBar to { bg = '#000000' }, WinBar hlgroup appears to be { fg = '#c8c093' } most cases.

How to reproduce:

  1. Create test.lua file (this would be minimal init.lua file)
vim.o.termguicolors = true
require('kanagawa').setup {
  overrides = {
    WinBar = { bg = '#000000' },
  }
}
vim.cmd('colorscheme kanagawa')

-- some keymaps for making test easy
vim.keymap.set('n', '<space>', function() vim.o.winbar = [[%f]] end)
vim.keymap.set('n', 'q', ':q<CR>')
  1. Run nvim with following command
nvim -u test.lua --no-plugin
nvim -u test.lua --no-plugin
nvim -u test.lua --no-plugin
...
  1. See WinBar highlight group overriding doesn't apply in most cases

image

image

I checked both neovim v0.8.0 and v0.9.0, but result was same.
Also, I'm pretty curious why this only happens for hlgroup WinBar. (StatusLine works fine)

nvim-cmp completion menu looks wierd

I just tried out this colorscheme and I really really love it but I'm not sure the highlighting on my completion menu is the way it's meant to be;
cmp

I don't really change highlights so I don't know what exactly in my setup could be causing it.

kanagawa.nvim is not working properly for Rust code after last update

Here is kanagawa.nvim at commit fc2e30820c73b0cf56bb0fb9e4a83dd8b90f9bf4 with nvim-treesitter at commit 4cccb6f494eb255b32a290d37c35ca12584c74d0 (before the removal of obsolete TS* highlight groups)
Screenshot from 2022-10-19 18-05-31

Here is a screenshot after the update, self and TODO: has no color . kanagawa.nvim at commit a6f8ea10900e8d891f9c93e0ed258f118010fb24 and nvim-treesitter at commit commit b9bcbf8d73b5a6c3e04922936b5fc500b436d4f5
Screenshot from 2022-10-19 18-06-10

I'm not sure if this is a problem with the kanagawa or with treesitter.

Errors in hlgroups.lua

Add support for split borders

With neovim/neovim#17266 being merged in it would be nice to have better highlights and drawing characters for splits.

This is what kanagawa looks like right now
image

As opposed to another colorscheme which implements it e.g. gruvbox or catppuccin
image

terminal colors not set

The terminal colors (:h terminal-config) aren't being set currently, so when in terminal mode (I assume) neovim just passes the color codes through to the terminal. This makes for some pretty ugly clashes if e.g. you're currently using a light colorscheme in the terminal (Also, fallback colors in Neovide (a neovim GUI) are pretty gaudy)

It would be nice if kanagawa would set these up in M.load()

The colors I'm talking about are the g:terminal_color_[0..15] variables. Copying the suggested terminal colors:

local kanagawa = require("kanagawa.colors").setup()
vim.g.terminal_color_0  = "#090618"               -- black
vim.g.terminal_color_1  = kanagawa.autumnRed      -- red
vim.g.terminal_color_2  = kanagawa.autumnGreen    -- green
vim.g.terminal_color_3  = kanagawa.boatYellow2    -- yellow
vim.g.terminal_color_4  = kanagawa.crystalBlue    -- blue
vim.g.terminal_color_5  = kanagawa.oniViolet      -- magenta
vim.g.terminal_color_6  = kanagawa.waveAqua1      -- cyan
vim.g.terminal_color_7  = kanagawa.oldWhite       -- white
vim.g.terminal_color_8  = kanagawa.fujiGray       -- bright black
vim.g.terminal_color_9  = kanagawa.samuraiRed     -- bright red
vim.g.terminal_color_10 = kanagawa.springGreen    -- bright green
vim.g.terminal_color_11 = kanagawa.carpYellow     -- bright yellow
vim.g.terminal_color_12 = kanagawa.springBlue     -- bright blue
vim.g.terminal_color_13 = kanagawa.springViolet1  -- bright magenta
vim.g.terminal_color_14 = kanagawa.waveAqua2      -- bright cyan
vim.g.terminal_color_15 = kanagawa.fujiWhite      -- bright white
vim.g.terminal_color_16 = kanagawa.surimiOrange   -- extended color 1
vim.g.terminal_color_17 = kanagawa.peachRed       -- extended color 2

#090618 doesn't seem to be specified in kanagawa.colors so I had to specify it manually.

Colors for Diffview Not Applied

Hello! Thank you for the great color scheme.

I'm using diffview to view changes in a file, and noticed that the way the colorscheme is currently configured, those changes are colored as grey and light grey, rather than the colors provided.

This is not ideal, I'd love it to be the traditional red as deleted, green as added, and so forth. Those colors are provided inside the themes.lua file, do they need to be applied somehow? How could one debug this?

Screen Shot 2022-01-01 at 9 50 04 PM

Thanks again!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.