Merge pull request #192 from folke/refactor

Refactor
This commit is contained in:
Folke Lemaitre 2022-09-05 21:49:06 +02:00 committed by GitHub
commit 0af477f7c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 111 additions and 39 deletions

View File

@ -148,8 +148,9 @@ require("tokyonight").setup({
}
```
Example for changing some settings and colors
```lua
-- Example config in Lua
require("tokyonight").setup({
-- use the night style
style = "night",
@ -164,9 +165,43 @@ require("tokyonight").setup({
colors.error = "#ff0000"
}
})
```
-- Load the colorscheme
vim.cmd[[colorscheme tokyonight]]
Example to make Telescope [borderless](https://github.com/nvim-telescope/telescope.nvim/wiki/Gallery#borderless)
```lua
require("tokyonight").setup({
on_highlights = function(hl, c)
local prompt = "#2d3149"
hl.TelescopeNormal = {
bg = c.bg_dark,
fg = c.fg_dark,
}
hl.TelescopeBorder = {
bg = c.bg_dark,
fg = c.bg_dark,
}
hl.TelescopePromptNormal = {
bg = prompt,
}
hl.TelescopePromptBorder = {
bg = prompt,
fg = prompt,
}
hl.TelescopePromptTitle = {
bg = prompt,
fg = prompt,
}
hl.TelescopePreviewTitle = {
bg = c.bg_dark,
fg = c.bg_dark,
}
hl.TelescopeResultsTitle = {
bg = c.bg_dark,
fg = c.bg_dark,
}
end,
})
```
### Making `undercurls` work properly in **Tmux**

View File

@ -196,8 +196,9 @@ TokyoNight will use the default options, unless you call `setup`.
<
Example for changing some settings and colors
>
-- Example config in Lua
require("tokyonight").setup({
-- use the night style
style = "night",
@ -212,9 +213,45 @@ TokyoNight will use the default options, unless you call `setup`.
colors.error = "#ff0000"
}
})
<
-- Load the colorscheme
vim.cmd[[colorscheme tokyonight]]
Example to make Telescope borderless
<https://github.com/nvim-telescope/telescope.nvim/wiki/Gallery#borderless>
>
require("tokyonight").setup({
on_highlights = function(hl, c)
local prompt = "#2d3149"
hl.TelescopeNormal = {
bg = c.bg_dark,
fg = c.fg_dark,
}
hl.TelescopeBorder = {
bg = c.bg_dark,
fg = c.bg_dark,
}
hl.TelescopePromptNormal = {
bg = prompt,
}
hl.TelescopePromptBorder = {
bg = prompt,
fg = prompt,
}
hl.TelescopePromptTitle = {
bg = prompt,
fg = prompt,
}
hl.TelescopePreviewTitle = {
bg = c.bg_dark,
fg = c.bg_dark,
}
hl.TelescopeResultsTitle = {
bg = c.bg_dark,
fg = c.bg_dark,
}
end,
})
<

View File

@ -7,7 +7,7 @@ colors:
# Normal colors
normal:
black: '0x15161E'
black: '0x15161e'
red: '0xf7768e'
green: '0x9ece6a'
yellow: '0xe0af68'

View File

@ -7,7 +7,7 @@ colors:
# Normal colors
normal:
black: '0x1D202F'
black: '0x1d202f'
red: '0xf7768e'
green: '0x9ece6a'
yellow: '0xe0af68'

View File

@ -1,6 +1,6 @@
# TokyoNight Color Palette
set -l foreground c0caf5
set -l selection 33467C
set -l selection 33467c
set -l comment 565f89
set -l red f7768e
set -l orange ff9e64

View File

@ -1,6 +1,6 @@
# TokyoNight Color Palette
set -l foreground c0caf5
set -l selection 364A82
set -l selection 364a82
set -l comment 565f89
set -l red f7768e
set -l orange ff9e64

View File

@ -1,14 +1,14 @@
[cursor]
color=c0caf5 33467C
color=c0caf5 33467c
[colors]
foreground=c0caf5
background=1a1b26
selection-foreground=c0caf5
selection-background=33467C
selection-background=33467c
urls=73daca
regular0=15161E
regular0=15161e
regular1=f7768e
regular2=9ece6a
regular3=e0af68

View File

@ -1,14 +1,14 @@
[cursor]
color=c0caf5 364A82
color=c0caf5 364a82
[colors]
foreground=c0caf5
background=24283b
selection-foreground=c0caf5
selection-background=364A82
selection-background=364a82
urls=73daca
regular0=1D202F
regular0=1d202f
regular1=f7768e
regular2=9ece6a
regular3=e0af68

View File

@ -8,7 +8,7 @@
background #1a1b26
foreground #c0caf5
selection_background #33467C
selection_background #33467c
selection_foreground #c0caf5
url_color #73daca
cursor #c0caf5
@ -19,10 +19,10 @@ active_tab_background #7aa2f7
active_tab_foreground #16161e
inactive_tab_background #292e42
inactive_tab_foreground #545c7e
#tab_bar_background #15161E
#tab_bar_background #15161e
# normal
color0 #15161E
color0 #15161e
color1 #f7768e
color2 #9ece6a
color3 #e0af68

View File

@ -8,7 +8,7 @@
background #24283b
foreground #c0caf5
selection_background #364A82
selection_background #364a82
selection_foreground #c0caf5
url_color #73daca
cursor #c0caf5
@ -19,10 +19,10 @@ active_tab_background #7aa2f7
active_tab_foreground #1f2335
inactive_tab_background #292e42
inactive_tab_foreground #545c7e
#tab_bar_background #1D202F
#tab_bar_background #1d202f
# normal
color0 #1D202F
color0 #1d202f
color1 #f7768e
color2 #9ece6a
color3 #e0af68

View File

@ -5,7 +5,7 @@
"foreground-color": "#c0caf5",
"background-color": "#1a1b26",
"palette": [
"#15161E",
"#15161e",
"#f7768e",
"#9ece6a",
"#e0af68",

View File

@ -5,7 +5,7 @@
"foreground-color": "#c0caf5",
"background-color": "#24283b",
"palette": [
"#1D202F",
"#1d202f",
"#f7768e",
"#9ece6a",
"#e0af68",

View File

@ -21,8 +21,8 @@ set -g status-right-length "100"
set -g status-left-style NONE
set -g status-right-style NONE
set -g status-left "#[fg=#15161E,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#16161e,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#16161e] #{prefix_highlight} #[fg=#3b4261,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#15161E,bg=#7aa2f7,bold] #h "
set -g status-left "#[fg=#15161e,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#16161e,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#16161e] #{prefix_highlight} #[fg=#3b4261,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#15161e,bg=#7aa2f7,bold] #h "
setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#16161e"
setw -g window-status-separator ""

View File

@ -21,8 +21,8 @@ set -g status-right-length "100"
set -g status-left-style NONE
set -g status-right-style NONE
set -g status-left "#[fg=#1D202F,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#1f2335,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1D202F,bg=#7aa2f7,bold] #h "
set -g status-left "#[fg=#1d202f,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#1f2335,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#1d202f,bg=#7aa2f7,bold] #h "
setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#1f2335"
setw -g window-status-separator ""

View File

@ -4,9 +4,9 @@ background = "#1a1b26"
cursor_bg = "#c0caf5"
cursor_border = "#c0caf5"
cursor_fg = "#1a1b26"
selection_bg = "#33467C"
selection_bg = "#33467c"
selection_fg = "#c0caf5"
ansi = ["#15161E", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", "#a9b1d6"]
ansi = ["#15161e", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", "#a9b1d6"]
brights = ["#414868", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", "#c0caf5"]

View File

@ -4,9 +4,9 @@ background = "#24283b"
cursor_bg = "#c0caf5"
cursor_border = "#c0caf5"
cursor_fg = "#24283b"
selection_bg = "#364A82"
selection_bg = "#364a82"
selection_fg = "#c0caf5"
ansi = ["#1D202F", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", "#a9b1d6"]
ansi = ["#1d202f", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", "#a9b1d6"]
brights = ["#414868", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", "#c0caf5"]

View File

@ -3,7 +3,7 @@ Name=TokyoNight Colors
ColorBackground=#1a1b26
ColorForeground=#c0caf5
ColorSelectionBackground=#33467C
ColorSelectionBackground=#33467c
ColorSelection=#c0caf5
ColorPalette=#15161E;#f7768e;#9ece6a;#e0af68;#7aa2f7;#bb9af7;#7dcfff;#a9b1d6;#414868;#f7768e;#9ece6a;#e0af68;#7aa2f7;#bb9af7;#7dcfff;#c0caf5
ColorPalette=#15161e;#f7768e;#9ece6a;#e0af68;#7aa2f7;#bb9af7;#7dcfff;#a9b1d6;#414868;#f7768e;#9ece6a;#e0af68;#7aa2f7;#bb9af7;#7dcfff;#c0caf5

View File

@ -3,7 +3,7 @@ Name=TokyoNight Colors
ColorBackground=#24283b
ColorForeground=#c0caf5
ColorSelectionBackground=#364A82
ColorSelectionBackground=#364a82
ColorSelection=#c0caf5
ColorPalette=#1D202F;#f7768e;#9ece6a;#e0af68;#7aa2f7;#bb9af7;#7dcfff;#a9b1d6;#414868;#f7768e;#9ece6a;#e0af68;#7aa2f7;#bb9af7;#7dcfff;#c0caf5
ColorPalette=#1d202f;#f7768e;#9ece6a;#e0af68;#7aa2f7;#bb9af7;#7dcfff;#a9b1d6;#414868;#f7768e;#9ece6a;#e0af68;#7aa2f7;#bb9af7;#7dcfff;#c0caf5

View File

@ -3,7 +3,7 @@
*background: #1a1b26
*foreground: #c0caf5
*color0: #15161E
*color0: #15161e
*color1: #f7768e
*color2: #9ece6a
*color3: #e0af68

View File

@ -3,7 +3,7 @@
*background: #24283b
*foreground: #c0caf5
*color0: #1D202F
*color0: #1d202f
*color1: #f7768e
*color2: #9ece6a
*color3: #e0af68