aebe43db9c
* fix: Background color Airline section B. Airline section B is used to show information regarding vcs, i.e. git branch. This section was formatted the same as section C, so they were indistinguishable. This commit changes the bachground color to the same one used for Lualine. * fix: Airline warning section in Replace mode The colors for the error and warning section of Airline were not applied to replace mode. This commit fixes this issue by instead defining the replace mode colors as a variation of the insert mode colors, where these colors are already deifned. Note that the red color is only applied to Airline sections A & B, but not on the right side, since the red color is already used there for the error section. This is different from Lualine, since there the error & warning sections don't exist. * feat: Add Terminal+Command mode colors to Airline This adds support for different colors for Airline in terminal mode and command mode, where before simply the normal mode colors where used. For terminal mode, its simply a copy of insert mode. This makes sense since it is basically insert mode just for the terminal buffer. In Lualine, this is done the same way. For command mode, it is a variation of normal mode. The orange color is also used in Lualine for this purpose. Only the sections A & B (on the left) are modified with this color, different from Lualine. Reason is the same as for Replace mode; the orange color is already used on the right for the warning section. |
||
---|---|---|
.github | ||
after/queries | ||
autoload | ||
colors | ||
doc | ||
lua | ||
tests | ||
.editorconfig | ||
.gitignore | ||
CHANGELOG.md | ||
LICENSE.md | ||
README.md | ||
stylua.toml |
Catppuccin for (Neo)vim
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
Flavours
Latte
Frappe
Macchiato
Mocha
Bake your own flavour! Here are some config from our community: (background source)
Features
- Supports both vim and neovim (Requires neovim >= 0.8 or vim >= 9 compiled with lua >= 5.1)
- Highly configurable with 4 different flavours and ability to create your own!
- Compile user config for fastest startuptime
- Integrations with lsp, treesitter and a bunch of plugins
- Supports for many other applications
Installation
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 }
use { "catppuccin/nvim", as = "catppuccin" }
Plug 'catppuccin/nvim', { 'as': 'catppuccin' }
Usage
colorscheme catppuccin " catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
vim.cmd.colorscheme "catppuccin"
Configuration
There is no need to call setup
if you don't want to change the default options and settings.
require("catppuccin").setup({
flavour = "mocha", -- latte, frappe, macchiato, mocha
-- flavour = "auto" -- will respect terminal's background
background = { -- :h background
light = "latte",
dark = "mocha",
},
transparent_background = false, -- disables setting the background color.
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
dim_inactive = {
enabled = false, -- dims the background color of inactive window
shade = "dark",
percentage = 0.15, -- percentage of the shade to apply to the inactive window
},
no_italic = false, -- Force no italic
no_bold = false, -- Force no bold
no_underline = false, -- Force no underline
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
comments = { "italic" }, -- Change the style of comments
conditionals = { "italic" },
loops = {},
functions = {},
keywords = {},
strings = {},
variables = {},
numbers = {},
booleans = {},
properties = {},
types = {},
operators = {},
-- miscs = {}, -- Uncomment to turn off hard-coded styles
},
color_overrides = {},
custom_highlights = {},
default_integrations = true,
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
treesitter = true,
notify = false,
mini = {
enabled = true,
indentscope_color = "",
},
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
},
})
-- setup must be called before loading
vim.cmd.colorscheme "catppuccin"
Customize highlights
Get catppuccin colors
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"
Returns a table where the key is the name of the color and the value is its hex value corresponding to each flavour.
Overwriting colors
Colors can be overwritten using color_overrides
in the setting, checkout https://github.com/catppuccin/nvim/discussions/323 for inspirations:
require("catppuccin").setup {
color_overrides = {
all = {
text = "#ffffff",
},
latte = {
base = "#ff0000",
mantle = "#242424",
crust = "#474747",
},
frappe = {},
macchiato = {},
mocha = {},
}
}
Note
For more information check out our style-guide
Overwriting highlight groups
Global highlight groups can be overwritten in the setting, for example:
require("catppuccin").setup {
custom_highlights = function(colors)
return {
Comment = { fg = colors.flamingo },
TabLineSel = { bg = colors.pink },
CmpBorder = { fg = colors.surface2 },
Pmenu = { bg = colors.none },
}
end
}
Per flavour highlight groups can also be overwritten in the setting, for 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,
},
}
Integrations
Catppuccin provides theme support for other plugins in the Neovim ecosystem and extended Neovim functionality through integrations.
To enable/disable an integration you just need to set it to true/false, for example:
require("catppuccin").setup({
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
treesitter = true,
notify = false,
mini = {
enabled = true,
indentscope_color = "",
},
}
})
Some integrations are enabled by default, you can control this behaviour with default_integrations
option.
require("catppuccin").setup({
default_integrations = false,
})
Below is a list of supported plugins and their corresponding integration module.
Important
If you'd like to know which highlight groups are being affected by catppuccin, check out this directory:
lua/catppuccin/groups/integrations/
.
Plugin | Default |
aerial.nvim |
|
alpha-nvim |
|
barbar.nvim |
|
barbecue.nvim |
SpecialUse this to set it up:
|
beacon.nvim |
|
bufferline.nvim |
SpecialUpdate your bufferline config to use the Catppuccin components:
Configurations are self-explanatory, see
|
coc.nvim |
SpecialSetting
In the inners tables you can set the style for the diagnostics, both
|
dashboard-nvim |
|
dropbar.nvim |
|
feline.nvim |
SpecialUpdate your Feline config to use the Catppuccin components:
Notice that calling Here are the defaults:
|
fern.vim |
|
fidget.nvim |
SpecialSet `notification.window.winblend` to `0`:
|
flash.nvim |
|
gitsigns.nvim |
|
harpoon |
|
headlines.nvim |
|
hop.nvim |
|
indent-blankline.nvim |
Special
|
leap.nvim |
|
lightline.vim |
Special
|
lightspeed.nvim |
|
lspsaga.nvim |
SpecialFor custom Lsp Kind Icon and Color
|
lualine.nvim |
Special
|
markdown |
|
mason.nvim |
|
mini.nvim |
|
neo-tree.nvim |
|
neogit |
|
neotest |
|
noice.nvim |
|
NormalNvim |
|
notifier.nvim |
|
nvim-cmp |
|
nvim-dap |
Special
|
nvim-dap-ui |
|
nvim-lspconfig |
SpecialIn the inners tables you can set the style for the diagnostics, both |
navic |
Special
|
nvim-notify |
|
nvim-semantic-tokens |
|
nvim-tree.lua |
|
nvim-treesitter-context |
|
nvim-treesitter |
|
nvim-ts-rainbow2 |
|
nvim-ts-rainbow |
|
nvim-ufo |
|
nvim-window-picker |
|
octo.nvim |
|
overseer.nvim |
|
pounce.nvim |
|
rainbow-delimiters.nvim |
|
reactive.nvim |
SpecialThere're 2 available presets ( Here is how you can use them.
To use another flavour just replace |
symbols-outline.nvim |
|
telekasten.nvim |
|
telescope.nvim |
|
trouble.nvim |
|
vim-airline |
Special
|
vim-clap |
SpecialUse this to set it up:
|
vim-gitgutter |
|
vim-illuminate |
|
vim-sandwich |
|
vim-sneak |
|
vimwiki |
|
which-key.nvim |
|
Compile
Important 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"
})
FAQ
Wrong treesitter highlights
Please disable additional_vim_regex_highlighting
require("nvim-treesitter.configs").setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false
},
}
Colors doesn't match preview screenshots
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
For tmux users
- Enable true color support to fix the following abnormal colors:
- Enable italic font support to fix the following incorrect if, then, else, end highlights:
Thanks to
Copyright © 2021-present Catppuccin Org