chore(command): Update readme

dev
nullchilly 2 years ago
parent 24191b87a2
commit 184d92919e

@ -86,6 +86,11 @@ There are already some sane defaults that you may like, however you can change t
dim_inactive = false, dim_inactive = false,
transparent_background = false, transparent_background = false,
term_colors = false, term_colors = false,
compile = {
enable = false,
path = vim.fn.stdpath "cache" .. "/catppuccin",
suffix = "_compiled"
},
styles = { styles = {
comments = { "italic" }, comments = { "italic" },
conditionals = { "italic" }, conditionals = { "italic" },
@ -287,6 +292,32 @@ integration = {
} }
``` ```
# Compiling
Catppuccin is a highly customizable and configurable colorscheme. This does however come at the cost of complexity and execution time.
Catppuccin can pre compute the results of your configuration and store the results in a compiled lua file. We use these precached values to set it's highlights.
To enable compile enables it in setup function:
```lua
compile = {
enable = true,
path = vim.fn.stdpath "cache" .. "/catppuccin",
suffix = "_compiled"
},
```
By default catppuccin writes the compiled results into the system's cache directory.
Catppuccin provides these commands to work with the catppuccin compiler.
```vim
:CatppuccinCompile # Create/update the compile files
:CatppuccinClean # Delete compiled files
```
Acknowledge: [nightfox.nvim#compile](https://github.com/EdenEast/nightfox.nvim#compile)
### Extra ### Extra
#### API #### API

@ -5,15 +5,19 @@ local flavours = {"latte", "frappe", "macchiato", "mocha"}
local command = vim.api.nvim_create_user_command local command = vim.api.nvim_create_user_command
command("Catppuccin", function(inp) command("Catppuccin", function(inp)
if not vim.tbl_contains(flavours, inp.args) then
local echo = require("catppuccin.utils.echo")
echo("Invalid flavour", "info")
return
end
vim.g.catppuccin_flavour = inp.args vim.g.catppuccin_flavour = inp.args
vim.cmd "colorscheme catppuccin" vim.cmd "colorscheme catppuccin"
end, { end, {
nargs = 1, nargs = 1,
complete = function(line) complete = function(line)
local builtin_list = flavours
return vim.tbl_filter(function(val) return vim.tbl_filter(function(val)
return vim.startswith(val, line) return vim.startswith(val, line)
end, builtin_list) end, flavours)
end end
}) })

Loading…
Cancel
Save