Skip to content

Commit 1ec3ea6

Browse files
committed
Add support for base16-vim alongside nvim-base16
1 parent 7d131a8 commit 1ec3ea6

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

THEMES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ But if `g:ayuprefermirage` exists, it will load ayu_mirage instead when
5454

5555
### base16
5656

57-
This theme will automatically use colors defined by your colorscheme using [RRethy/nvim-base16](https://github.com/RRethy/nvim-base16)] plugin.
57+
This theme will automatically use colors defined by your colorscheme using [tinted-theming/base16-vim](https://github.com/tinted-theming/base16-vim) or [RRethy/nvim-base16](https://github.com/RRethy/nvim-base16)] plugin.
5858
The following example is using the `tomorrow-night` colorscheme:
5959

6060
<p>

lua/lualine/themes/base16.lua

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ local function setup_default()
5050
}
5151
end
5252

53-
local function setup_base16()
53+
local function setup_base16_nvim()
54+
-- Continue to load nvim-base16
5455
local loaded, base16 = pcall(require, 'base16-colorscheme')
5556

5657
if not loaded then
@@ -89,4 +90,23 @@ local function setup_base16()
8990
}
9091
end
9192

92-
return setup_base16() or setup_default()
93+
local function setup_base16_vim()
94+
-- Check if tinted-theming/base16-vim is already loaded
95+
if vim.g.base16_gui00 and vim.g.base16_gui0F then
96+
return setup {
97+
bg = vim.g.base16_gui01,
98+
alt_bg = vim.g.base16_gui02,
99+
dark_fg = vim.g.base16_gui03,
100+
fg = vim.g.base16_gui04,
101+
light_fg = vim.g.base16_gui05,
102+
normal = vim.g.base16_gui0D,
103+
insert = vim.g.base16_gui0B,
104+
visual = vim.g.base16_gui0E,
105+
replace = vim.g.base16_gui09,
106+
}
107+
end
108+
109+
return nil
110+
end
111+
112+
return setup_base16_vim() or setup_base16_nvim() or setup_default()

0 commit comments

Comments
 (0)