Merge pull request #194 from nullchilly/lua

refactor(colors): Remove vimscript & Resolve dev telescope & Update auto-compile readme
dev
Pocco81 2 years ago committed by GitHub
commit cfead5ace4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -299,7 +299,7 @@ Catppuccin is a highly customizable and configurable colorscheme. This does howe
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. 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: - To enable compile enables it in setup function:
```lua ```lua
compile = { compile = {
@ -310,36 +310,54 @@ compile = {
``` ```
By default catppuccin writes the compiled results into the system's cache directory. By default catppuccin writes the compiled results into the system's cache directory.
Catppuccin provides these commands to work with the catppuccin compiler. - Catppuccin provides these commands to work with the catppuccin compiler.
```bash ```bash
:CatppuccinCompile # Create/update the compile file :CatppuccinCompile # Create/update the compile file
:CatppuccinClean # Delete compiled file :CatppuccinClean # Delete compiled file
``` ```
It's recommended to add `:CatppuccinCompile` to run everytime you update your config. For example: - It's recommended to add `:CatppuccinCompile` to post-install/update hooks. For example:
#### Packer.nvim
```lua ```lua
use { use {
"catppuccin/nvim", "catppuccin/nvim",
as = "catppuccin", as = "catppuccin",
run = ":CatppuccinCompile", run = "CatppuccinCompile",
} }
``` ```
To auto-compile catppuccin after `:PackerCompile`, create an autocmd `PackerCompileDone` in User group #### Vim-plug
```lua
Plug 'catppuccin/nvim', {'as': 'catppuccin', 'do': 'CatppuccinCompile'}
```
- To auto-compile everytime you update your config:
#### Packer.nvim
For example, if your plugin specification is in `~/.config/nvim/lua/plugins.lua` then the pattern is `plugins.lua` Create an autocmd `User PackerCompileDone` to update it every time packer is compiled:
```lua ```lua
vim.api.nvim_create_autocmd("User PackerCompileDone", { vim.api.nvim_create_autocmd("User", {
pattern = "plugins.lua", pattern = "PackerCompileDone",
callback = function() callback = function()
vim.cmd "CatppuccinCompile" vim.cmd "CatppuccinCompile"
end, end,
}) })
``` ```
#### Vim-plug
Auto compile on save if catppuccin config is in `init.vim`
```lua
autocmd BufWritePost init.vim :CatppuccinCompile
```
Acknowledge: [nightfox.nvim#compile](https://github.com/EdenEast/nightfox.nvim#compile) Acknowledge: [nightfox.nvim#compile](https://github.com/EdenEast/nightfox.nvim#compile)
### Extra ### Extra

@ -0,0 +1 @@
require("catppuccin").load()

@ -1,3 +0,0 @@
lua << EOF
require('catppuccin').load()
EOF

@ -6,16 +6,16 @@ function M.get()
TelescopeSelectionCaret = { fg = cp.flamingo }, TelescopeSelectionCaret = { fg = cp.flamingo },
TelescopeSelection = { fg = cp.text, bg = cp.surface0, style = { "bold" } }, TelescopeSelection = { fg = cp.text, bg = cp.surface0, style = { "bold" } },
TelescopeMatching = { fg = cp.blue }, TelescopeMatching = { fg = cp.blue },
TelescopePromptPrefix = { bg = cp.crust }, -- TelescopePromptPrefix = { bg = cp.crust },
TelescopePromptNormal = { bg = cp.crust }, -- TelescopePromptNormal = { bg = cp.crust },
TelescopeResultsNormal = { bg = cp.mantle }, -- TelescopeResultsNormal = { bg = cp.mantle },
TelescopePreviewNormal = { bg = cp.crust }, -- TelescopePreviewNormal = { bg = cp.crust },
TelescopePromptBorder = { bg = cp.crust, fg = cp.crust }, -- TelescopePromptBorder = { bg = cp.crust, fg = cp.crust },
TelescopeResultsBorder = { bg = cp.mantle, fg = cp.crust }, -- TelescopeResultsBorder = { bg = cp.mantle, fg = cp.crust },
TelescopePreviewBorder = { bg = cp.crust, fg = cp.crust }, -- TelescopePreviewBorder = { bg = cp.crust, fg = cp.crust },
TelescopePromptTitle = { fg = cp.crust }, -- TelescopePromptTitle = { fg = cp.crust },
TelescopeResultsTitle = { fg = cp.text }, -- TelescopeResultsTitle = { fg = cp.text },
TelescopePreviewTitle = { fg = cp.crust }, -- TelescopePreviewTitle = { fg = cp.crust },
} }
end end

Loading…
Cancel
Save