Skip to content

Commit

Permalink
feat: added kitty color schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Apr 20, 2021
1 parent a425e02 commit 5785dff
Show file tree
Hide file tree
Showing 10 changed files with 555 additions and 360 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ A dark Neovim theme written in Lua ported from the Visual Studio Code [TokyoNigh

## ✨ Features

+ supports the latest Neovim 5.0 features like TreeSitter and LSP
+ minimal inactive statusline
+ vim terminal colors
+ darker background for sidebar-like windows
+ color configs for [Kitty](https://sw.kovidgoyal.net/kitty/conf.html?highlight=include)
+ **lualine** theme

### Plugin Support

+ [TreeSitter](https://github.com/nvim-treesitter/nvim-treesitter)
+ [LSP Diagnostics](https://neovim.io/doc/user/lsp.html)
+ [LSP Saga](https://github.com/glepnir/lspsaga.nvim)
Expand All @@ -24,7 +33,7 @@ A dark Neovim theme written in Lua ported from the Visual Studio Code [TokyoNigh
+ [Indent Blankline](https://github.com/lukas-reineke/indent-blankline.nvim)
+ [Dashboard](https://github.com/glepnir/dashboard-nvim)
+ [BufferLine](https://github.com/akinsho/nvim-bufferline.lua)
+ a TokyNight [Lualine](https://github.com/hoob3rt/lualine.nvim) theme is included
+ [Lualine](https://github.com/hoob3rt/lualine.nvim)

## 📦 Installation

Expand Down Expand Up @@ -81,7 +90,6 @@ The theme comes in two styles, `storm` and a darker variant `night`.
| tokyonight_hide_inactive_statusline | `false` | Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. |
| tokyonight_sidebars | `{}` | Set a darker background on sidebar-like windows. For example: `["quickfix", "__vista__", "terminal"]` |


```lua
-- Example config in Lua
vim.g.tokyonight_style = "night"
Expand All @@ -95,3 +103,11 @@ let g:tokyonight_style = "night"
let g:tokyonight_italic_functions = true
let g:tokyonight_sidebars = [ "quickfix", "__vista__", "terminal" ]
```

## 🍭 Extras

Two color configs for **Kitty** can be found at [/extra](extra/). To use them, copy the color config you want to your Kitty condif directory and append the following in yout `kitty.conf`

```kitty
include other.conf
```
9 changes: 9 additions & 0 deletions extra/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
cd "$DIR/.."

export LUA_PATH="./lua/?/init.lua;./lua/?.lua"
lua -e 'require"tokyonight.extra"'
40 changes: 40 additions & 0 deletions extra/kitty_tokyonight_night.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# TokyoNight colors for Kitty

background #1a1b26
foreground #c0caf5
selection_background #33467C
selection_foreground #c0caf5
url_color #73daca
cursor #c0caf5

# Tabs
active_tab_background #7aa2f7
active_tab_foreground #1f2335
inactive_tab_background #292e42
inactive_tab_foreground #545c7e
#tab_bar_background #15161E

# normal
color0 #414868
color1 #f7768e
color2 #9ece6a
color3 #e0af68
color4 #7aa2f7
color5 #bb9af7
color6 #7dcfff
color7 #a9b1d6

# bright
color8 #414868
color9 #f7768e
color10 #9ece6a
color11 #e0af68
color12 #7aa2f7
color13 #bb9af7
color14 #7dcfff
color15 #c0caf5

# extended colors
color16 #ff9e64
color17 #db4b4b

40 changes: 40 additions & 0 deletions extra/kitty_tokyonight_storm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# TokyoNight colors for Kitty

background #24283b
foreground #c0caf5
selection_background #364A82
selection_foreground #c0caf5
url_color #73daca
cursor #c0caf5

# Tabs
active_tab_background #7aa2f7
active_tab_foreground #1f2335
inactive_tab_background #292e42
inactive_tab_foreground #545c7e
#tab_bar_background #1D202F

# normal
color0 #414868
color1 #f7768e
color2 #9ece6a
color3 #e0af68
color4 #7aa2f7
color5 #bb9af7
color6 #7dcfff
color7 #a9b1d6

# bright
color8 #414868
color9 #f7768e
color10 #9ece6a
color11 #e0af68
color12 #7aa2f7
color13 #bb9af7
color14 #7dcfff
color15 #c0caf5

# extended colors
color16 #ff9e64
color17 #db4b4b

2 changes: 1 addition & 1 deletion lua/lualine/themes/tokyonight.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local colors = require("tokyonight.colors")
local colors = require("tokyonight.colors").setup()

local tokyonight = {}

Expand Down
121 changes: 64 additions & 57 deletions lua/tokyonight/colors.lua
Original file line number Diff line number Diff line change
@@ -1,59 +1,66 @@
local util = require("tokyonight.util")
local config = require("tokyonight.config")

-- Color Palette
---@class ColorScheme
local colors = {
none = "NONE",
bg_dark = "#1f2335",
bg = "#24283b",
bg_highlight = "#292e42",
terminal_black = "#414868",
fg = "#c0caf5",
fg_dark = "#a9b1d6",
fg_gutter = "#3b4261",
dark3 = "#545c7e",
comment = "#565f89",
dark5 = "#737aa2",
blue0 = "#3d59a1",
blue = "#7aa2f7",
cyan = "#7dcfff",
blue1 = "#2ac3de",
blue5 = "#89ddff",
blue6 = "#B4F9F8",
magenta = "#bb9af7",
purple = "#9d7cd8",
orange = "#ff9e64",
yellow = "#e0af68",
green = "#9ece6a",
green1 = "#73daca",
teal = "#1abc9c",
red = "#f7768e",
red1 = "#db4b4b",
diff = { change = "#394b70", add = "#164846", delete = "#823c41" },
git = { change = "#6183bb", add = "#449dab", delete = "#914c54" },
}
if config.style == "night" then colors.bg = "#1a1b26" end
util.bg = colors.bg
colors.git.ignore = colors.dark3
colors.black = util.darken(colors.bg, 0.8, "#000000")
colors.border_highlight = colors.blue0
colors.border = colors.black

colors.bg_popup = colors.bg_dark
colors.bg_sidebar = colors.bg_dark
colors.bg_statusline = colors.bg_dark
colors.bg_float = colors.bg
colors.bg_visual = util.darken(colors.blue0, 0.7)
colors.bg_search = colors.blue0
colors.fg_sidebar = colors.fg_dark

colors.error = colors.red1
colors.warning = colors.yellow
colors.info = colors.teal
colors.hint = colors.info

-- util.fg = colors.fg

return colors

local M = {}

---@param config Config
---@return ColorScheme
function M.setup(config)
config = config or require("tokyonight.config")

-- Color Palette
---@class ColorScheme
local colors = {
none = "NONE",
bg_dark = "#1f2335",
bg = "#24283b",
bg_highlight = "#292e42",
terminal_black = "#414868",
fg = "#c0caf5",
fg_dark = "#a9b1d6",
fg_gutter = "#3b4261",
dark3 = "#545c7e",
comment = "#565f89",
dark5 = "#737aa2",
blue0 = "#3d59a1",
blue = "#7aa2f7",
cyan = "#7dcfff",
blue1 = "#2ac3de",
blue5 = "#89ddff",
blue6 = "#B4F9F8",
magenta = "#bb9af7",
purple = "#9d7cd8",
orange = "#ff9e64",
yellow = "#e0af68",
green = "#9ece6a",
green1 = "#73daca",
teal = "#1abc9c",
red = "#f7768e",
red1 = "#db4b4b",
diff = { change = "#394b70", add = "#164846", delete = "#823c41" },
git = { change = "#6183bb", add = "#449dab", delete = "#914c54" },
}

if config.style == "night" then colors.bg = "#1a1b26" end
util.bg = colors.bg
colors.git.ignore = colors.dark3
colors.black = util.darken(colors.bg, 0.8, "#000000")
colors.border_highlight = colors.blue0
colors.border = colors.black

colors.bg_popup = colors.bg_dark
colors.bg_sidebar = colors.bg_dark
colors.bg_statusline = colors.bg_dark
colors.bg_float = colors.bg
colors.bg_visual = util.darken(colors.blue0, 0.7)
colors.bg_search = colors.blue0
colors.fg_sidebar = colors.fg_dark

colors.error = colors.red1
colors.warning = colors.yellow
colors.info = colors.teal
colors.hint = colors.info
return colors
end

return M

16 changes: 16 additions & 0 deletions lua/tokyonight/extra.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local config = require("tokyonight.config")
local kitty = require("tokyonight.kitty")

local function write(str, fileName)
local file = io.open("extra/" .. fileName, "w")
file:write(str)
file:close()
end

config.style = "storm"

write(kitty.kitty(config), "kitty_tokyonight_storm.conf")

config.style = "night"

write(kitty.kitty(config), "kitty_tokyonight_night.conf")
7 changes: 6 additions & 1 deletion lua/tokyonight/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
local util = require("tokyonight.util")
local theme = require("tokyonight.theme")

return { colorscheme = function() util.load(theme) end }
local M = {}

function M.colorscheme() util.load(theme.setup()) end

return M

54 changes: 54 additions & 0 deletions lua/tokyonight/kitty.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
local util = require("tokyonight.util")

local M = {}

function M.kitty(config)
config = config or require("tokyonight.config")
local colors = require("tokyonight.colors").setup(config)

local kitty = util.template([[
# TokyoNight colors for Kitty
background ${bg}
foreground ${fg}
selection_background ${bg_visual}
selection_foreground ${fg}
url_color ${green1}
cursor ${fg}
# Tabs
active_tab_background ${blue}
active_tab_foreground ${bg_dark}
inactive_tab_background ${bg_highlight}
inactive_tab_foreground ${dark3}
#tab_bar_background ${black}
# normal
color0 ${terminal_black}
color1 ${red}
color2 ${green}
color3 ${yellow}
color4 ${blue}
color5 ${magenta}
color6 ${cyan}
color7 ${fg_dark}
# bright
color8 ${terminal_black}
color9 ${red}
color10 ${green}
color11 ${yellow}
color12 ${blue}
color13 ${magenta}
color14 ${cyan}
color15 ${fg}
# extended colors
color16 ${orange}
color17 ${red1}
]], colors)
return kitty
end

return M

Loading

0 comments on commit 5785dff

Please sign in to comment.