chore(readme): Update auto-compile examples

dev
nullchilly 2 years ago
parent 0f266b54d6
commit 40801defb4

@ -356,26 +356,29 @@ Plug 'catppuccin/nvim', {'as': 'catppuccin', 'do': 'CatppuccinCompile'}
Packer.nvim Packer.nvim
```lua ```lua
-- Create an autocmd `User PackerCompileDone` to update it every time packer is compiled -- If you want catppuccin live reload after :PackerCompile
autocmd("User", { require("packer").init {
auto_reload_compiled = true,
}
```
```lua
-- Create an autocmd User PackerCompileDone to update it every time packer is compiled
vim.api.nvim_create_autocmd("User", {
pattern = "PackerCompileDone", pattern = "PackerCompileDone",
callback = function() callback = function()
vim.cmd "CatppuccinCompile" vim.cmd "CatppuccinCompile"
vim.defer_fn(function()
vim.cmd "colorscheme catppuccin" vim.cmd "colorscheme catppuccin"
end, 50) -- Debounced for live reloading
end, end,
}) })
``` ```
```lua
-- Enable auto reload compiled in packer setting
require("packer").init {
auto_reload_compiled = true,
}
```
Vim-plug Vim-plug
```bash ```bash
# Auto compile on save if catppuccin config is in `init.vim` # Auto compile on save if catppuccin config is written inside init.vim
autocmd BufWritePost init.vim :CatppuccinCompile autocmd BufWritePost init.vim :CatppuccinCompile
``` ```

Loading…
Cancel
Save