add autocmd for automatically compiling base46
This commit is contained in:
parent
7daf171948
commit
e8e7ed6144
|
@ -4,10 +4,6 @@ vim.env.PATH = vim.env.PATH .. (is_windows and ";" or ":") .. vim.fn.stdpath "da
|
|||
|
||||
local new_cmd = vim.api.nvim_create_user_command
|
||||
|
||||
new_cmd("CompileNvTheme", function()
|
||||
require("base46").load_all_highlights()
|
||||
end, {})
|
||||
|
||||
new_cmd("NvChadUpdate", function()
|
||||
require("nvchad").update_nvchad()
|
||||
end, {})
|
||||
|
@ -22,3 +18,15 @@ autocmd("FileType", {
|
|||
vim.opt_local.buflisted = false
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("BufWritePost", {
|
||||
pattern = "*lua",
|
||||
callback = function()
|
||||
local bufname = vim.api.nvim_buf_get_name(0)
|
||||
|
||||
if string.find(bufname, "custom") and string.find(bufname, "lua") then
|
||||
require("plenary.reload").reload_module "base46"
|
||||
require("base46").load_all_highlights()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue