From c9cc5a997f1dae3f35b4bdd62f35958fee363ab4 Mon Sep 17 00:00:00 2001 From: Null Chilly Date: Mon, 29 May 2023 17:09:08 +0700 Subject: [PATCH] feat(debug): add auto compile on save --- lua/catppuccin/init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/catppuccin/init.lua b/lua/catppuccin/init.lua index 78954020..ab33d703 100644 --- a/lua/catppuccin/init.lua +++ b/lua/catppuccin/init.lua @@ -185,4 +185,13 @@ vim.api.nvim_create_user_command("CatppuccinCompile", function() vim.api.nvim_command "colorscheme catppuccin" end, {}) +if vim.g.catppuccin_debug then + vim.api.nvim_create_autocmd("BufWritePost", { + pattern = "*/catppuccin/*", + callback = function() + vim.schedule(function() vim.cmd "CatppuccinCompile" end) + end, + }) +end + return M