add windows support for compile theme autocmd
This commit is contained in:
parent
e8e7ed6144
commit
5246faa09a
@ -25,7 +25,7 @@ M.lazy = function(install_path)
|
||||
require "plugins"
|
||||
|
||||
vim.fn.mkdir(vim.g.base46_cache, "p")
|
||||
vim.cmd "CompileNvTheme"
|
||||
require("base46").load_all_highlights()
|
||||
require("lazy").load { plugins = "nvim-treesitter" }
|
||||
|
||||
-- install binaries from mason.nvim & tsparsers on LazySync
|
||||
|
@ -19,14 +19,37 @@ autocmd("FileType", {
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("BufWritePost", {
|
||||
pattern = "*lua",
|
||||
callback = function()
|
||||
local bufname = vim.api.nvim_buf_get_name(0)
|
||||
local sep = vim.loop.os_uname().sysname:find "windows" and "\\" or "/"
|
||||
|
||||
if string.find(bufname, "custom") and string.find(bufname, "lua") then
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = vim.fn.glob(
|
||||
table.concat({
|
||||
vim.fn.stdpath "config",
|
||||
"lua",
|
||||
"custom",
|
||||
"**",
|
||||
"*.lua",
|
||||
}, sep),
|
||||
true,
|
||||
true,
|
||||
true
|
||||
),
|
||||
|
||||
group = vim.api.nvim_create_augroup("ReloadNvChad", {}),
|
||||
|
||||
callback = function(opts)
|
||||
require("plenary.reload").reload_module "base46"
|
||||
local file = string
|
||||
.gsub(vim.fn.fnamemodify(opts.file, ":r"), vim.fn.stdpath "config" .. sep .. "lua" .. sep, "")
|
||||
:gsub(sep, ".")
|
||||
require("plenary.reload").reload_module(file)
|
||||
require("plenary.reload").reload_module "custom.chadrc"
|
||||
|
||||
local config = require("core.utils").load_config().ui
|
||||
|
||||
vim.opt.statusline = "%!v:lua.require('nvchad_ui.statusline." .. config.statusline.theme .. "').run()"
|
||||
|
||||
require("base46").load_all_highlights()
|
||||
end
|
||||
-- vim.cmd("redraw!")
|
||||
end,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user