LunarVim/lua/lvim/core/theme.lua
LostNeophyte 60c7ad77fd
perf: lazy load most plugins (#3750)
* perf: lazy load most plugins

* fix(lazy): suggested fixes for pref/lazyloading branch (#3754)

fix(lazy): Suggested fixes from previous comments

fix(lazy): applying suggestions from code review

Co-authored-by: LostNeophyte <lostneophyte@tuta.io>

Co-authored-by: Pratyush Bharati <pbharati@Pratyushs-MacBook-Pro.local>
Co-authored-by: LostNeophyte <lostneophyte@tuta.io>

* chore: format

* move lazy utils to modules.lua

* simplify telescope actions

* refactor: cmp_window local name

* feat: more lazy loading cmds

* refactor(cmp): minor clean up

* perf: set lazy loading by default

* refactor(alpha): remove broken lazy load

* revert: explictily set lazy loading

This reverts commit ba38193e4e.

* test: enable lazy-loading for bigfile

* perf: defer projects and alpha to VimEnter

* refactor(bufferline): add comment

* perf: better lazy load dap/dapui

* perf: lazy load ts-commentstring with Comment.nvim pre_hook

---------

Co-authored-by: pr-313 <46706232+pr-313@users.noreply.github.com>
Co-authored-by: Pratyush Bharati <pbharati@Pratyushs-MacBook-Pro.local>
Co-authored-by: opalmay <opal.mizrahi2@gmail.com>
Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
2023-02-04 17:22:41 +02:00

96 lines
3.3 KiB
Lua

local Log = require "lvim.core.log"
local M = {}
M.config = function()
lvim.builtin.theme = {
name = "lunar",
lunar = {
options = { -- currently unused
},
},
tokyonight = {
options = {
on_highlights = function(hl, c)
hl.IndentBlanklineContextChar = {
fg = c.dark5,
}
hl.TSConstructor = {
fg = c.blue1,
}
hl.TSTagDelimiter = {
fg = c.dark5,
}
end,
style = "night", -- The theme comes in three styles, `storm`, a darker variant `night` and `day`
transparent = lvim.transparent_window, -- Enable this to disable setting the background color
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
styles = {
-- Style to be applied to different syntax groups
-- Value is any valid attr-list value for `:help nvim_set_hl`
comments = { italic = true },
keywords = { italic = true },
functions = {},
variables = {},
-- Background styles. Can be "dark", "transparent" or "normal"
sidebars = "dark", -- style for sidebars, see below
floats = "dark", -- style for floating windows
},
-- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
sidebars = {
"qf",
"vista_kind",
"terminal",
"packer",
"spectre_panel",
"NeogitStatus",
"help",
},
day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
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**.
dim_inactive = false, -- dims inactive windows
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
use_background = true, -- can be light/dark/auto. When auto, background will be set to vim.o.background
},
},
}
end
M.setup = function()
-- avoid running in headless mode since it's harder to detect failures
if #vim.api.nvim_list_uis() == 0 then
Log:debug "headless mode detected, skipping running setup for lualine"
return
end
local selected_theme = lvim.builtin.theme.name
if vim.startswith(lvim.colorscheme, selected_theme) then
local status_ok, plugin = pcall(require, selected_theme)
if not status_ok then
return
end
pcall(function()
plugin.setup(lvim.builtin.theme[selected_theme].options)
end)
end
-- ref: https://github.com/neovim/neovim/issues/18201#issuecomment-1104754564
local colors = vim.api.nvim_get_runtime_file(("colors/%s.*"):format(lvim.colorscheme), false)
if #colors == 0 then
Log:debug(string.format("Could not find '%s' colorscheme", lvim.colorscheme))
return
end
vim.g.colors_name = lvim.colorscheme
vim.cmd("colorscheme " .. lvim.colorscheme)
if package.loaded.lualine then
require("lvim.core.lualine").setup()
end
if package.loaded.lir then
require("lvim.core.lir").icon_setup()
end
end
return M