new autocmd event `CatppuccinLoaded`

dev
Zhong Liu 2 years ago
parent ffd6f3e104
commit 37e99450cf

@ -336,6 +336,20 @@ catppuccin.before_loading = function ()
end
```
#### Autocmd
Instead of `after_loading` hook, you can use autocmd event like this:
```lua
vim.api.nvim_create_autocmd("User", {
pattern = "CatppuccinLoaded",
callback = function()
local colors = require("catppuccin.api.colors").get_colors()
-- do something with colors
end
})
```
## 💝 Thanks to
- [Pocco81](https://github.com/Pocco81)

@ -21,6 +21,8 @@ local function load()
if catppuccin.after_loading ~= nil then
catppuccin.after_loading()
end
vim.api.nvim_exec_autocmds("User", { pattern = "CatppuccinLoaded" })
end
function M.main(option)

Loading…
Cancel
Save