temp, testing
This commit is contained in:
31
src_files/.config/nvim/lua/theme.lua
Normal file
31
src_files/.config/nvim/lua/theme.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
local defaultColorScheme = "tokyodark"
|
||||
-- local defaultColorScheme = "tokyonight-night"
|
||||
-- local defaultColorScheme = "bamboo-vulgaris"
|
||||
-- local defaultColorScheme = "rose-pine-main"
|
||||
-- local defaultColorScheme = "gruvbox"
|
||||
-- local defaultColorScheme = "slate"
|
||||
-- local defaultColorScheme = "sorbet"
|
||||
|
||||
local ok, theme_specs = pcall(dofile, (os.getenv('DIR_CURRENT_THEME') or "") .. "/neovim.lua")
|
||||
if not ok then
|
||||
vim.notify(
|
||||
'current theme file not found, using default: ' .. defaultColorScheme,
|
||||
vim.log.levels.INFO
|
||||
)
|
||||
vim.cmd.colorscheme(defaultColorScheme)
|
||||
return
|
||||
end
|
||||
|
||||
local first = theme_specs[1]
|
||||
local plugin_name = (type(first.name) == 'string' and first.name)
|
||||
or (type(first[1]) == 'string' and first[1]:match('.*/(.*)'))
|
||||
or 'plugin_name_not_found'
|
||||
|
||||
local last = theme_specs[#theme_specs]
|
||||
local colorscheme = ((type(last.opts) == 'table' and type(last.opts.colorscheme) == 'string') and last.opts.colorscheme)
|
||||
or plugin_name:gsub("%.%w+$", "")
|
||||
|
||||
colorscheme = (colorscheme == 'plugin_name_not_found' and defaultColorScheme)
|
||||
or colorscheme
|
||||
vim.cmd.colorscheme(colorscheme)
|
||||
|
Reference in New Issue
Block a user