From 8ad6845386e0263e236db870ae8221c837a5b854 Mon Sep 17 00:00:00 2001 From: siduck Date: Sun, 23 Jun 2024 18:48:26 +0530 Subject: [PATCH] move some autocmds into ui repo as the filetype one is related to tabufline and the bufwritepost one is used for reloading nvconfig --- lua/nvchad/autocmds.lua | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/lua/nvchad/autocmds.lua b/lua/nvchad/autocmds.lua index 17588b0..47437aa 100644 --- a/lua/nvchad/autocmds.lua +++ b/lua/nvchad/autocmds.lua @@ -1,37 +1,5 @@ local autocmd = vim.api.nvim_create_autocmd --- dont list quickfix buffers -autocmd("FileType", { - pattern = "qf", - callback = function() - vim.opt_local.buflisted = false - end, -}) - --- reload some chadrc options on-save -autocmd("BufWritePost", { - pattern = vim.tbl_map(function(path) - return vim.fs.normalize(vim.loop.fs_realpath(path)) - end, vim.fn.glob(vim.fn.stdpath "config" .. "/lua/**/*.lua", true, true, true)), - group = vim.api.nvim_create_augroup("ReloadNvChad", {}), - - callback = function(opts) - local fp = vim.fn.fnamemodify(vim.fs.normalize(vim.api.nvim_buf_get_name(opts.buf)), ":r") --[[@as string]] - local app_name = vim.env.NVIM_APPNAME and vim.env.NVIM_APPNAME or "nvim" - local module = string.gsub(fp, "^.*/" .. app_name .. "/lua/", ""):gsub("/", ".") - - require("plenary.reload").reload_module "nvconfig" - require("plenary.reload").reload_module "chadrc" - require("plenary.reload").reload_module "base46" - require("plenary.reload").reload_module "nvchad" - require("plenary.reload").reload_module(module) - - require("nvchad") - require("base46").load_all_highlights() - -- vim.cmd("redraw!") - end, -}) - -- user event that loads after UIEnter + only if file buf is there autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, { group = vim.api.nvim_create_augroup("NvFilePost", { clear = true }),