add an option for lsp_semantic_tokens hl groups | fix (#1907)

also tiden up some stuff
This commit is contained in:
siduck 2023-04-10 06:04:37 +05:30
parent b5cf9fde0e
commit f873d3cc50
3 changed files with 27 additions and 22 deletions

View file

@ -50,11 +50,13 @@ M.gen_chadrc_template = function()
local path = vim.fn.stdpath "config" .. "/lua/custom/" local path = vim.fn.stdpath "config" .. "/lua/custom/"
local input = vim.fn.input "Do you want to install example custom config? (y/N) : " local input = vim.fn.input "Do you want to install example custom config? (y/N) : "
-- clone example_config repo
if input == "y" then if input == "y" then
M.echo "cloning example custom config repo ..." M.echo "cloning example custom config repo ..."
vim.fn.system { "git", "clone", "--depth", "1", "https://github.com/NvChad/example_config", path } vim.fn.system { "git", "clone", "--depth", "1", "https://github.com/NvChad/example_config", path }
vim.fn.delete(path .. ".git", "rf") vim.fn.delete(path .. ".git", "rf")
else else
-- use very minimal chadrc
vim.fn.mkdir(path, "p") vim.fn.mkdir(path, "p")
local file = io.open(path .. "chadrc.lua", "w") local file = io.open(path .. "chadrc.lua", "w")

View file

@ -18,6 +18,7 @@ M.ui = {
theme_toggle = { "onedark", "one_light" }, theme_toggle = { "onedark", "one_light" },
theme = "onedark", -- default theme theme = "onedark", -- default theme
transparency = false, transparency = false,
lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens
-- cmp themeing -- cmp themeing
cmp = { cmp = {

View file

@ -52,6 +52,7 @@ M.remove_disabled_keys = function(chadrc_mappings, default_mappings)
end end
M.load_mappings = function(section, mapping_opt) M.load_mappings = function(section, mapping_opt)
vim.schedule(function()
local function set_section_map(section_values) local function set_section_map(section_values)
if section_values.plugin then if section_values.plugin then
return return
@ -83,6 +84,7 @@ M.load_mappings = function(section, mapping_opt)
for _, sect in pairs(mappings) do for _, sect in pairs(mappings) do
set_section_map(sect) set_section_map(sect)
end end
end)
end end
M.lazy_load = function(plugin) M.lazy_load = function(plugin)