![Logo](https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/logos/exports/1544x1544_circle.png)
Catppuccin for Neovim
This port of Catppuccin is special because it was the first one and the one that originated the project itself. Given this, it's important to acknowledge that it all didn't come to be what it is now out of nowhere. So, if you are interested in knowing more about the initial stages of the theme, you can find it under the v0.1 tag
You can bake your own flavour! Here are some from our community:
amoled
![](https://user-images.githubusercontent.com/56817415/197349645-af9243e0-044b-4c08-9928-c359e7500eba.png)
Configuration:
require("catppuccin").setup {
flavour = "mocha",
color_overrides = {
mocha = {
base = "#000000",
}
},
integrations = {
nvimtree = true,
},
custom_highlights = {
NvimTreeNormal = { bg = "NONE" },
}
}
Share your custom flavour here! catppuccin#323
- Handy CLI.
- Extensible for many use cases.
- Compile user config for faster startuptime
- Integrations with a bunch of plugins
You can use your favorite plugin manager for this. Here are some examples with the most popular ones:
use {
"catppuccin/nvim",
as = "catppuccin",
config = function()
require("catppuccin").setup {
flavour = "macchiato" -- mocha, macchiato, frappe, latte
}
vim.api.nvim_command "colorscheme catppuccin"
end
}
call plug#begin()
Plug 'catppuccin/nvim', { 'as': 'catppuccin' }
call plug#end()
lua << EOF
require("catppuccin").setup {
flavour = "macchiato" -- mocha, macchiato, frappe, latte
}
EOF
colorscheme catppuccin
If you want to switch your Catppuccin flavour "on the fly" you may use this command:
:Catppuccin mocha/macchiato/frappe/latte
Note: the command has autocompletion enabled, so you can just press tab to cycle through the flavours
" There are also colorschemes for the different flavour
colorscheme catppuccin-mocha
colorscheme catppuccin-macchiato
colorscheme catppuccin-frappe
colorscheme catppuccin-latte
You may pass a lua table to the setup()
function in order to edit any of Catppuccin's settings:
require("catppuccin").setup({
flavour = "mocha", -- latte, frappe, macchiato, mocha
background = { -- :h background
light = "latte",
dark = "mocha",
},
compile_path = vim.fn.stdpath("cache") .. "/catppuccin",
transparent_background = false,
term_colors = false,
dim_inactive = {
enabled = false,
shade = "dark",
percentage = 0.15,
},
styles = {
comments = { "italic" },
conditionals = { "italic" },
loops = {},
functions = {},
keywords = {},
strings = {},
variables = {},
numbers = {},
booleans = {},
properties = {},
types = {},
operators = {},
},
color_overrides = {},
custom_highlights = {},
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
telescope = true,
treesitter = true,
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
},
})
Although settings already have self-explanatory names, here is where you can find info about each one of them and their classifications!
This settings are unrelated to any group and are independent.
background
: (Table) Match :set background=light/dark with :Catppuccin background.light/darkterm_colors
: (Boolean) if true, sets terminal colors (e.g.g:terminal_color_0
).transparent_background
: (Boolean) if true, disables setting the background color.
This setting manages the ability to dim the inactive splits/windows/buffers displayed.
enabled
: (Boolean) if true, dims the background color of inactive window or buffer or split.shade
: (string) sets the shade to apply to the inactive split or window or buffer.percentage
: (number 0 < x < 1) percentage of the shade to apply to the inactive window, split or buffer.
Handles the style of general hi groups (see :h highlight-args
):
comments
: (Table) changed the style of the comments.functions
: (Table) changed the style of the functions.keywords
: (Table) changed the style of the keywords.strings
: (Table) changed the style of the strings.variables
: (Table) changed the style of the variables.
local latte = require("catppuccin.palettes").get_palette "latte"
local frappe = require("catppuccin.palettes").get_palette "frappe"
local macchiato = require("catppuccin.palettes").get_palette "macchiato"
local mocha = require("catppuccin.palettes").get_palette "mocha"
Will returns a table where the key is the name of the color and the value is its hex value corresponding to each flavour.
Colors can be overwritten using color_overrides
in the setting, like so:
require("catppuccin").setup {
color_overrides = {
all = {
text = "#ffffff",
},
latte = {
base = "#ff0000",
mantle = "#242424",
crust = "#474747",
},
frappe = {},
macchiato = {},
mocha = {},
}
}
Global highlight groups can be overwritten in the setting like so:
custom_highlights = function(colors)
return {
<hl_group> = { <fields> }
}
end
Here is an example:
require("catppuccin").setup {
custom_highlights = function(colors)
return {
Comment = { fg = colors.flamingo },
["@constant.builtin"] = { fg = colors.peach, style = {} },
["@comment"] = { fg = colors.surface2, style = { "italic" }
}
end
}
Per flavour highlight groups can be overwritten in the setting like so:
highlight_overrides = {
all = function(colors) -- Global highlight, will be replaced with custom_highlights if exists
return {
<hl_group> = { <fields> }
}
end, -- Same for each flavour
latte = function(latte) end,
frappe = function(frappe) end,
macchiato = function(macchiato) end,
mocha = function(mocha) end,
}
Here is an example:
require("catppuccin").setup {
highlight_overrides = {
all = function(colors)
return {
NvimTreeNormal = { fg = colors.none },
CmpBorder = { fg = "#3e4145" },
}
end,
latte = function(latte)
return {
Normal = { fg = latte.base },
}
end,
frappe = function(frappe)
return {
["@comment"] = { fg = frappe.surface2, style = { "italic" } },
}
end,
macchiato = function(macchiato)
return {
LineNr = { fg = macchiato.overlay1 },
}
end,
mocha = function(mocha)
return {
Comment = { fg = mocha.flamingo },
}
end,
},
}
catppuccin-nvim provides theme support for other plugins in the Neovim ecosystem and extended Neovim functionality through integrations.
Below is a list of supported plugins and their corresponding integration module. (See Special integrations for more.)
"Special" module means Special integrations, see https://github.com/catppuccin/nvim#special-integrations for more details
These integrations allow catppuccin to set the theme of various plugins. To enable an integration you just need to set it to true
, for example:
require("catppuccin").setup({
integrations = {
<module> = <boolean>
}
})
Click here to see an example config
require("catppuccin").setup({
integrations = {
aerial = false,
barbar = false,
beacon = false,
cmp = true,
coc_nvim = false,
dashboard = true,
fern = false,
fidget = false,
gitgutter = false,
gitsigns = true,
harpoon = false,
hop = false,
illuminate = false,
leap = false,
lightspeed = false,
lsp_saga = false,
lsp_trouble = false,
markdown = true,
mason = true,
mini = false,
neogit = false,
neotest = false,
neotree = false,
noice = false,
notify = false,
nvimtree = true,
overseer = false,
pounce = false,
semantic_tokens = false,
symbols_outline = false,
telekasten = false,
telescope = true,
treesitter = true,
treesitter_context = false,
ts_rainbow = false,
vim_sneak = false,
vimwiki = false,
which_key = false,
-- Special integrations, see https://github.com/catppuccin/nvim#special-integrations
dap = {
enabled = false,
enable_ui = false,
},
indent_blankline = {
enabled = true,
colored_indent_levels = false,
},
native_lsp = {
enabled = true,
virtual_text = {
errors = { "italic" },
hints = { "italic" },
warnings = { "italic" },
information = { "italic" },
},
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
},
},
navic = {
enabled = false,
custom_bg = "NONE",
},
},
})
bufferline.nvim
Update your bufferline config to use the Catppuccin components:
Note: bufferline needs to be loaded after setting up catppuccin or it will highlight incorrectly
use "akinsho/bufferline.nvim" {
after = "catppuccin",
config = function()
require("bufferline").setup {
highlights = require("catppuccin.groups.integrations.bufferline").get()
}
end
}
Configurations are self-explanatory, see :h bufferline-highlights
for detailed explanations:
local mocha = require("catppuccin.palettes").get_palette "mocha"
bufferline.setup {
highlights = require("catppuccin.groups.integrations.bufferline").get {
styles = { "italic", "bold" },
custom = {
all = {
fill = { bg = "#000000" },
},
mocha = {
background = { fg = mocha.text },
},
latte = {
background = { fg = "#000000" },
},
},
},
}
feline.nvim
First make sure that the kyazdani42/nvim-web-devicons plugin is installed. Then update your Feline config to use the Catppuccin components:
local ctp_feline = require('catppuccin.groups.integrations.feline')
ctp_feline.setup()
require("feline").setup({
components = ctp_feline.get(),
})
Notice that calling setup()
is optional. You may pass a lua table in order to change assets, settings and the colors per vim mode.
Here are the defaults:
local clrs = require("catppuccin.palettes").get_palette()
local ctp_feline = require('catppuccin.groups.integrations.feline')
ctp_feline.setup({
assets = {
left_separator = "๎ถ",
right_separator = "๎ด",
bar = "โ",
mode_icon = "๏ฎ",
dir = " ๏ ",
file = " ๏ ",
lsp = {
server = " ๏ ",
error = " ๏ ",
warning = " ๏ ",
info = " ๏ ",
hint = " ๏ ",
},
git = {
branch = " ๏ฃ ",
added = " ๏ ",
changed = " ๏
",
removed = " ๏ ",
},
},
sett = {
text = ucolors.vary_color({ latte = latte.base }, clrs.surface0),
bkg = ucolors.vary_color({ latte = latte.crust }, clrs.surface0),
diffs = clrs.mauve,
extras = clrs.overlay1,
curr_file = clrs.maroon,
curr_dir = clrs.flamingo,
show_modified = true -- show if the file has been modified
},
mode_colors = {
["n"] = { "NORMAL", clrs.lavender },
["no"] = { "N-PENDING", clrs.lavender },
["i"] = { "INSERT", clrs.green },
["ic"] = { "INSERT", clrs.green },
["t"] = { "TERMINAL", clrs.green },
["v"] = { "VISUAL", clrs.flamingo },
["V"] = { "V-LINE", clrs.flamingo },
["๏ฟฝ"] = { "V-BLOCK", clrs.flamingo },
["R"] = { "REPLACE", clrs.maroon },
["Rv"] = { "V-REPLACE", clrs.maroon },
["s"] = { "SELECT", clrs.maroon },
["S"] = { "S-LINE", clrs.maroon },
["๏ฟฝ"] = { "S-BLOCK", clrs.maroon },
["c"] = { "COMMAND", clrs.peach },
["cv"] = { "COMMAND", clrs.peach },
["ce"] = { "COMMAND", clrs.peach },
["r"] = { "PROMPT", clrs.teal },
["rm"] = { "MORE", clrs.teal },
["r?"] = { "CONFIRM", clrs.mauve },
["!"] = { "SHELL", clrs.green },
}
})
Note: Currently feline doesn't officially support custom themes. In order for
:Catppuccin <flavour>
to work you could add this autocmd as a workaround:
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "*",
callback = function()
package.loaded["feline"] = nil
package.loaded["catppuccin.groups.integrations.feline"] = nil
require("feline").setup {
components = require("catppuccin.groups.integrations.feline").get(),
}
end,
})
fidget.nvim
Set fidget module to true
fidget = true
Then set window.blend
to 0
:
require("fidget").setup {
window = {
blend = 0,
},
-- ... the rest of your fidget config
}
indent-blankline.nvim
Setting enabled
to true
enables this integration. colored_indent_levels
enables char highlights per indent level. Follow the instructions here to set the latter up.
indent_blankline = {
enabled = true,
colored_indent_levels = false,
},
lightline.vim
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'}
lualine.nvim
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
}
}
nvim-dap & nvim-dap-ui
Setting enabled
to true
:
integration = {
dap = {
enabled = true,
enable_ui = true, -- enable nvim-dap-ui
}
}
-- You NEED to override nvim-dap's default highlight groups, AFTER requiring nvim-dap
require("dap")
local sign = vim.fn.sign_define
sign("DapBreakpoint", { text = "โ", texthl = "DapBreakpoint", linehl = "", numhl = ""})
sign("DapBreakpointCondition", { text = "โ", texthl = "DapBreakpointCondition", linehl = "", numhl = ""})
sign("DapLogPoint", { text = "โ", texthl = "DapLogPoint", linehl = "", numhl = ""})
nvim-lspconfig
Setting enabled
to true
enables this integration. In the inners tables you can set the style for the diagnostics, both virtual_text
(what you see on the side) and underlines
(what points directly at the thing (e.g. an error)).
native_lsp = {
enabled = true,
virtual_text = {
errors = { "italic" },
hints = { "italic" },
warnings = { "italic" },
information = { "italic" },
},
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
},
},
nvim-navic
Setting enabled
to true
:
navic = {
enabled = false,
custom_bg = "NONE",
},
-- You NEED to enable highlight in nvim-navic setting or it won't work
require("nvim-navic").setup {
highlight = true
}
vim-clap
Use this to set it up:
let g:clap_theme = 'catppuccin'
If you'd like to know which highlight groups are being affected by catppuccin, check out this directory: lua/catppuccin/groups/integrations/
.
Note: As of 7/10/2022, catppuccin should be able to automatically recompile when the setup table changed.
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.
By default catppuccin writes the compiled results into the system's cache directory. You can change the cache dir using:
require("catppuccin").setup({ -- Note: On windows we replace `/` with `\` by default
compile_path = vim.fn.stdpath "cache" .. "/catppuccin"
})
:CatppuccinCompile " Create/update the compile file
require('catppuccin').compile() -- Catppuccin also provide a function to work with the catppuccin compiler.
Use them to execute code at certain events. These are the ones available:
Autocmd | Description |
---|---|
ColorSchemePre |
Before loading a colorscheme |
ColorScheme |
After loading a colorscheme |
They can be used like so:
vim.api.nvim_create_autocmd("ColorSchemePre", {
pattern = "*",
callback = function()
print "I ran before loading Catppuccin!"
end
})
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "*",
callback = function()
local colors = require("catppuccin.palettes").get_palette()
-- do something with colors
end
})
require("catppuccin.lib.highlighter").syntax()
For example:
local colors = require("catppuccin.palettes").get_palette() -- fetch colors from palette
require("catppuccin.lib.highlighter").syntax({
Comment = { fg = colors.surface0 }
})
Note: Unlike the
:highlight
command which can update a highlight group, this function completely replaces the definition. (:h nvim_set_hl
)
Please disable additional_vim_regex_highlighting
require("nvim-treesitter.configs").setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false
},
}
Catppuccin requires true color support AKA terminals support the full range of 16 million colors
- Supported: iterm2 (macOS), kitty, wezterm, alacritty, tmux, ...
Full list of support terminals can be found here: https://github.com/termstandard/colors#truecolor-support-in-output-devices
- Unsupported terminal: Terminal.app (macOS), Terminus, Terminology, ...
Full list of Unsupported terminals can be found here: https://github.com/termstandard/colors#not-supporting-truecolor
ย
Copyright ยฉ 2021-present Catppuccin Org