d790197c82
feat: Catppuccin for xresources |
3 years ago | |
---|---|---|
autoload/lightline/colorscheme | 3 years ago | |
colors | 3 years ago | |
extra | 3 years ago | |
lua | 3 years ago | |
plugin | 3 years ago | |
.editorconfig | 3 years ago | |
.gitignore | 3 years ago | |
CONTRIBUTING.md | 3 years ago | |
LICENSE.md | 3 years ago | |
README.md | 3 years ago | |
stylua.toml | 3 years ago |
README.md
Read this:
Hello there and thanks for following the development of Catppuccin.nvim: remastered version. This branch is meant to hopefully end up being merged to main. As of now, all of the development discussions are carried out on #44, so feel free to leave your suggestions and ideas there :)
About
π² Table of Contents
π¨ Flavors
Dark catppuccin
Neon Latte
Soft Manilo
Light Melya
π· Extra
Tmux Ports
Β Β Β
Β Β Β
π Features
- Multiple colorschemes (AKA flavors) available!
- Handy CLI.
- Allows user remaps.
- Extensible for many use cases.
- Integrations with a lot of stuff:
πΊ Notices
Checkout the CHANGELOG.md file for more information on the notices below:
- 03-09-21: Ported catppuccin themes to Tmux!
- 01-09-21: Added API and functionality for remapping colors and highlight groups + added lightspeed.nvim integration.
- 29-08-21: Refactored diffs and git related stuff, added the `CPClear` command and added option to set terminal colors
- 22-08-21: Just released!
Old notices...
π¦ Installation
Prerequisites
Adding the plugin
You can use your favorite plugin manager for this. Here are some examples with the most popular ones:
Vim-plug
Plug 'Pocco81/Catppuccin.nvim'
Packer.nvim
use "Pocco81/Catppuccin.nvim"
Vundle
Plugin 'Pocco81/Catppuccin.nvim'
NeoBundle
NeoBundleFetch 'Pocco81/Catppuccin.nvim'
Setup
There are already some sane defaults that you may like, however you can change them to match your taste. These are the defaults:
colorscheme = "dark_catppuccin",
transparency = false,
term_colors = false,
styles = {
comments = "italic",
functions = "italic",
keywords = "italic",
strings = "NONE",
variables = "NONE",
},
integrations = {
treesitter = true,
native_lsp = {
enabled = true,
virtual_text = {
errors = "italic",
hints = "italic",
warnings = "italic",
information = "italic",
},
underlines = {
errors = "underline",
hints = "underline",
warnings = "underline",
information = "underline",
}
},
lsp_trouble = false,
lsp_saga = false,
gitgutter = false,
gitsigns = false,
telescope = false,
nvimtree = {
enabled = false,
show_root = false,
},
which_key = false,
indent_blankline = {
enabled = false,
colored_indent_levels = false,
},
dashboard = false,
neogit = false,
vim_sneak = false,
fern = false,
barbar = false,
bufferline = false,
markdown = false,
lightspeed = false,
ts_rainbow = false,
hop = false,
}
The way you setup the settings on your configuration varies on whether you are using vimL for this or Lua.
For init.lua
local catppuccin = require("catppuccin")
-- configure it
catppuccin.setup(
{
colorscheme = "dark_catppuccin",
transparency = false,
term_colors = false,
styles = {
comments = "italic",
functions = "italic",
keywords = "italic",
strings = "NONE",
variables = "NONE",
},
integrations = {
treesitter = true,
native_lsp = {
enabled = true,
virtual_text = {
errors = "italic",
hints = "italic",
warnings = "italic",
information = "italic",
},
underlines = {
errors = "underline",
hints = "underline",
warnings = "underline",
information = "underline",
}
},
lsp_trouble = false,
lsp_saga = false,
gitgutter = false,
gitsigns = false,
telescope = false,
nvimtree = {
enabled = false,
show_root = false,
},
which_key = false,
indent_blankline = {
enabled = false,
colored_indent_levels = false,
},
dashboard = false,
neogit = false,
vim_sneak = false,
fern = false,
barbar = false,
bufferline = false,
markdown = false,
lightspeed = false,
ts_rainbow = false,
hop = false,
}
}
)
For init.vim
lua << EOF
local catppuccin = require("catppuccin")
-- configure it
catppuccin.setup(
{
colorscheme = "dark_catppuccin",
transparency = false,
term_colors = false,
styles = {
comments = "italic",
functions = "italic",
keywords = "italic",
strings = "NONE",
variables = "NONE",
},
integrations = {
treesitter = true,
native_lsp = {
enabled = true,
virtual_text = {
errors = "italic",
hints = "italic",
warnings = "italic",
information = "italic",
},
underlines = {
errors = "underline",
hints = "underline",
warnings = "underline",
information = "underline",
}
},
lsp_trouble = false,
lsp_saga = false,
gitgutter = false,
gitsigns = false,
telescope = false,
nvimtree = {
enabled = false,
show_root = false,
},
which_key = false,
indent_blankline = {
enabled = false,
colored_indent_levels = false,
},
dashboard = false,
neogit = false,
vim_sneak = false,
fern = false,
barbar = false,
bufferline = false,
markdown = false,
lightspeed = false,
ts_rainbow = false,
hop = false,
}
}
)
EOF
After setting things up, you can load catppuccin like so:
" Vim Script
colorscheme catppuccin
-- Lua
vim.cmd[[colorscheme catppuccin]]
Passing catppuccin
to the colorscheme
command will pick the colorscheme in the config. Optionally, you could pass one by its code name (e.g. colorscheme neon_latte
).
For instructions on how to configure the plugin, check out the configuration section.
Updating
This depends on your plugin manager. If, for example, you are using Packer.nvim, you can update it with this command:
:PackerUpdate
π€ Usage
Commands
The provides commands that follows the camel casing naming convention and have the CP
prefix so that it's easy to remember that they are part of Catppuccin.nvim:
:CPClear
clear all highlight groups.:colorscheme <colorscheme_name>
load a colorscheme, not necessarily a catppuccin one. (Note: this is a built-in NVim command).
API
The API allows you fetch data from catppuccin. It can be required as a Lua module:
local cp_api = require("catppuccin.api.<module>")
Modules
colors
cp_api.get_colors(<colorscheme>)
Gets the colors from
<colorscheme>
. Returns two values: the first one is a table with astatus
field (for the exit status) and amsg
field with an error message in casestatus
isfalse
(error), and the second value is a table with the colors. If it fails, it will return the colors fromdark_catppuccin
.
π¬ Configuration
Although settings already have self-explanatory names, here is where you can find info about each one of them and their classifications!
General
This settings are unrelated to any group and are independent.
colorscheme
: (String) code name of the color-scheme to be used. All of them can be found in the section below.transparency
: (Boolean) if true, disables setting the background color.term_colors
: (Boolean) if true, sets terminal colors (e.g.g:terminal_color_0
).
Styles
Handles the style of general hi groups (see :h highlight-args
):
comments
: (String) changed the style of the comments.functions
: (String) changed the style of the functions.keywords
: (String) changed the style of the keywords.strings
: (String) changed the style of the strings.variables
: (String) changed the style of the variables.
Integrations
These integrations allow catppuccin to set the theme of various plugins/stuff. To enable an integration you just need to set it to true
, however, there are some special integrations...
If you'd like to know which highlight groups are being affected by catppuccin, checkout this directory: lua/catppuccin/core/integrations/
.
Special Integrations
- Native Nvim LSP: setting
enabled
totrue
enables this integration. In the inners tables you can set the style for the diagnostics, bothvirtual_text
(what you see on the side) andunderlines
(what points directly at the thing (e.g. an error)). - Lualine: use this to set it up (Note:
catppuccin
is the only valid theme name. It will pick the one set in your config):
require('lualine').setup {
options = {
theme = "catppuccin"
-- ... the rest of your lualine config
}
}
- Lightline: use this to set it up (Note:
catppuccin
is the only valid colorscheme name. It will pick the one set in your config):
let g:lightline = {'colorscheme': 'catppuccin'}
- Kitty: Copy and paste the file corresponding to theme you want to use from this directory on your Kitty config.
- Alacritty: Copy and paste the file corresponding to theme you want to use from this directory on your Alacritty config.
- Tmux: Follow the instructions here
- Indent-blankline.nvim: setting
enabled
totrue
enables this integration.colored_indent_levels
enables char highlights per indent level. Follow the instructions here to set the latter up. - NvimTree: setting
enabled
totrue
enables this integration:
integration = {
nvimtree = {
enabled = true,
show_root = true, -- makes the root folder not transparent
}
}
List of colorschemes
Colorschemes | Code Names |
---|---|
Dark catppuccin | dark_catppuccin |
Neon Latte | neon_latte |
Soft Manilo | soft_manilo |
Light Melya | light_melya |
Overwriting colors & hi groups
Both colors and highlight groups can be overwritten like so:
catppuccin.remap({<colors>},{<hi_groups>})
Since you want to overwrite hi groups, then it's likely that you'll want to use the API to get the colors from x colorscheme as well:
local err, colors = cp_api.get_colors("neon_latte")
Here is an example using the API to overwrite the color green and change the style of the comments:
local cp_api = require("catppuccin.api.colors")
local err, colors = cp_api.get_colors("neon_latte")
if err.status then -- good
catppuccin.remap({
green = "#ffffff"
},
{
Comment = { fg = colors.comment, style = "bold" }, -- any comment
})
end
- For colorschemes: all editable fields are the same as the ones mentioned in any of the colorschemes found at:
lua/catppuccin/color_schemes
. You could also use one as a template, if you will. - For highlight groups: all the highlight groups have three editable fields:
fg
for the foreground,bg
for the background andstyle
for the style.
Hooks
Use them to execute code at certain events [described by their names]. These are the ones available:
Function | Description |
---|---|
before_loading() |
Before loading a colorscheme |
after_loading() |
After loading a colorscheme |
They can be used like so:
local catppuccin = require("catppuccin")
catppuccin.before_loading = function ()
print("I ran before setting a colorscheme!")
end
π FAQ
-
Q: "How can I view the doc from NeoVim?" A: Use
:help Catppuccin.nvim
-
Q: "Why are the colorschemes named like that? Do they follow any convention(s)?" A: A colorscheme's name is constructed by two words: the first one is a word that represents the tonalities in the colors used and the second one is the name of a coffee drink from this list.
π Contribute
See CONTRIBUTING.md.
π Inspirations
The following projects inspired the creation of Catppuccin.nvim. If possible, go check them out to see why they are so amazing :]
- folke/tokyonight.nvim: A clean, dark Neovim theme written in Lua, with support for lsp, treesitter and lots of plugins. Includes additional themes for Kitty, Alacritty, iTerm and Fish.
- norcalli/nvim-base16.lua: Programmatic lua library for setting base16 themes in Neovim.
π License
Catppuccin.nvim is released under the GPL v3.0 license. It grants open-source permissions for users including:
- The right to download and run the software freely
- The right to make changes to the software as desired
- The right to redistribute copies of the software
- The right to modify and distribute copies of new versions of the software
For more convoluted language, see the LICENSE file.
π TO-DO
High Priority
- Add Aquamarine FrappΓ©
Low Priority
- Finish DOC
- Add more integrations
Enjoy!