# nvim **Repository Path**: william135/nvim ## Basic Information - **Project Name**: nvim - **Description**: neovim catppuccin主题 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-12-18 - **Last Updated**: 2022-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README

Logo
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

# Previews
Mocha
Macchiato
Frappe
Latte
**[You can bake your own flavour!](https://github.com/catppuccin/nvim/#overwriting-colors) Here are some from our community:**
Amoled `#000000`! [Configuration can be found here](https://github.com/nullchilly/nvim/blob/nvim/lua/config/catppuccin.lua) Here is a subset of it: ```lua require("catppuccin").setup { flavour = "mocha", color_overrides = { mocha = { base = "#000000", }, }, integrations = { nvimtree = true, }, highlight_overrides = { mocha = function(mocha) return { NvimTreeNormal = { bg = mocha.none }, } end, }, } ```
An attempt to restore the original theme based on Mocha! [Configuration can be found here](https://github.com/ayamir/nvimdots/blob/61fe5b7f5374beaee18c0c730441d55ad5911604/lua/modules/ui/config.lua#L125) Catppuccino
Share your custom flavour here! # Features - Highly configurable with 4 different flavours and ability to create [many more](https://github.com/catppuccin/nvim/discussions/323) - [Compile](https://github.com/catppuccin/nvim#Compile) user config for [fastest startuptime](https://www.reddit.com/r/neovim/comments/xxfpt3/catppuccinnvim_now_startup_in_1ms/) - Integrations with [a bunch of plugins](https://github.com/catppuccin/nvim#integrations) # Installation ```lua use { "catppuccin/nvim", as = "catppuccin" } ``` ```vim Plug 'catppuccin/nvim', { 'as': 'catppuccin' } ``` # Usage ```vim colorscheme catppuccin " catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha ``` ```lua vim.cmd.colorscheme "catppuccin" ``` # Configuration There is no need to call `setup` if you don't want to change the default options and settings. ```lua require("catppuccin").setup({ flavour = "mocha", -- latte, frappe, macchiato, mocha background = { -- :h background light = "latte", dark = "mocha", }, transparent_background = false, term_colors = false, dim_inactive = { enabled = false, shade = "dark", percentage = 0.15, }, no_italic = false, -- Force no italic no_bold = false, -- Force no bold 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, notify = false, mini = false, -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) }, }) -- setup must be called before loading vim.cmd.colorscheme "catppuccin" ``` 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. - `background`: (Table) Match :set background=light/dark with :Catppuccin background.light/dark - `term_colors`: (Boolean) if true, sets terminal colors (e.g. `g:terminal_color_0`). - `transparent_background`: (Boolean) if true, disables setting the background color. ## Dim inactive 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. ## Styles 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. # Customize highlights ## Get catppuccin colors ```lua 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. ## Overwriting colors Colors can be overwritten using `color_overrides` in the setting, like so: ```lua require("catppuccin").setup { color_overrides = { all = { text = "#ffffff", }, latte = { base = "#ff0000", mantle = "#242424", crust = "#474747", }, frappe = {}, macchiato = {}, mocha = {}, } } ```
Click here to see color palette document | Name | Latte | Frappe | Macchiato | Mocha | Usage | | --------- | --------- | --------- | --------- | --------- | --------------- | | rosewater | `#dc8a78` | `#F2D5CF` | `#F4DBD6` | `#F5E0DC` | Winbar | | flamingo | `#DD7878` | `#EEBEBE` | `#F0C6C6` | `#F2CDCD` | Target word | | pink | `#ea76cb` | `#F4B8E4` | `#F5BDE6` | `#F5C2E7` | Just pink | | mauve | `#8839EF` | `#CA9EE6` | `#C6A0F6` | `#CBA6F7` | Tag | | red | `#D20F39` | `#E78284` | `#ED8796` | `#F38BA8` | Error | | maroon | `#E64553` | `#EA999C` | `#EE99A0` | `#EBA0AC` | Lighter red | | peach | `#FE640B` | `#EF9F76` | `#F5A97F` | `#FAB387` | Number | | yellow | `#df8e1d` | `#E5C890` | `#EED49F` | `#F9E2AF` | Warning | | green | `#40A02B` | `#A6D189` | `#A6DA95` | `#A6E3A1` | Diff add | | teal | `#179299` | `#81C8BE` | `#8BD5CA` | `#94E2D5` | Hint | | sky | `#04A5E5` | `#99D1DB` | `#91D7E3` | `#89DCEB` | Operator | | sapphire | `#209FB5` | `#85C1DC` | `#7DC4E4` | `#74C7EC` | Constructor | | blue | `#1e66f5` | `#8CAAEE` | `#8AADF4` | `#89B4FA` | Diff changed | | lavender | `#7287FD` | `#BABBF1` | `#B7BDF8` | `#B4BEFE` | CursorLine Nr | | text | `#4C4F69` | `#c6d0f5` | `#CAD3F5` | `#CDD6F4` | Default fg | | subtext1 | `#5C5F77` | `#b5bfe2` | `#B8C0E0` | `#BAC2DE` | Indicator | | subtext0 | `#6C6F85` | `#a5adce` | `#A5ADCB` | `#A6ADC8` | Float title | | overlay2 | `#7C7F93` | `#949cbb` | `#939AB7` | `#9399B2` | Popup fg | | overlay1 | `#8C8FA1` | `#838ba7` | `#8087A2` | `#7F849C` | Conceal color | | overlay0 | `#9CA0B0` | `#737994` | `#6E738D` | `#6C7086` | Fold color | | surface2 | `#ACB0BE` | `#626880` | `#5B6078` | `#585B70` | Default comment | | surface1 | `#BCC0CC` | `#51576d` | `#494D64` | `#45475A` | Darker comment | | surface0 | `#CCD0DA` | `#414559` | `#363A4F` | `#313244` | Darkest comment | | base | `#EFF1F5` | `#303446` | `#24273A` | `#1E1E2E` | Default bg | | mantle | `#E6E9EF` | `#292C3C` | `#1E2030` | `#181825` | Darker bg | | crust | `#DCE0E8` | `#232634` | `#181926` | `#11111B` | Darkest bg |
## Overwriting highlight groups Global highlight groups can be overwritten in the setting like so: ```lua custom_highlights = function(colors) return { = { } } end ``` Here is an example: ```lua 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: ```lua highlight_overrides = { all = function(colors) -- Global highlight, will be replaced with custom_highlights if exists return { = { } } 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: ```lua 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-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](https://github.com/catppuccin/nvim#special-integrations) for more.) | Plugin | Module | | ------------------------------------------------------------------------------------- | ------------------- | | [aerial.nvim](https://github.com/stevearc/aerial.nvim) | aerial | | [barbar.nvim](https://github.com/romgrk/barbar.nvim) | barbar | | [beacon.nvim](https://github.com/DanilaMihailov/beacon.nvim) | beacon | | [bufferline.nvim](https://github.com/akinsho/bufferline.nvim) | Special | | [dashboard-nvim](https://github.com/glepnir/dashboard-nvim) | dashboard | | [feline.nvim](https://github.com/feline-nvim/feline.nvim/) | Special | | [fern.vim](https://github.com/lambdalisue/fern.vim) | fern | | [fidget.nvim](https://github.com/j-hui/fidget.nvim) | Special | | [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) | gitsigns | | [harpoon](https://github.com/ThePrimeagen/harpoon) | harpoon | | [hop.nvim](https://github.com/phaazon/hop.nvim) | hop | | [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim) | Special | | [leap.nvim](https://github.com/ggandor/leap.nvim) | leap | | [lightline.vim](https://github.com/itchyny/lightline.vim) | Special | | [lightspeed.nvim](https://github.com/ggandor/lightspeed.nvim) | lightspeed | | [lspsaga.nvim](https://github.com/glepnir/lspsaga.nvim/) | lsp_saga, Special | | [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) | Special | | [markdown](https://www.markdownguide.org/) | markdown | | [mason](https://github.com/williamboman/mason.nvim) | mason | | [mini.nvim](https://github.com/echasnovski/mini.nvim) | mini | | [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim) | neotree | | [neogit](https://github.com/TimUntersberger/neogit) | neogit | | [neotest](https://github.com/nvim-neotest/neotest) | neotest | | [noice.nvim](https://github.com/folke/noice.nvim) | noice | | [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) | cmp | | [nvim-dap-ui](https://github.com/rcarriga/nvim-dap-ui) | dap, Special | | [nvim-dap](https://github.com/mfussenegger/nvim-dap) | dap, Special | | [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) | native_lsp, Special | | [nvim-navic](https://github.com/SmiteshP/nvim-navic/) | navic, Special | | [nvim-notify](https://github.com/rcarriga/nvim-notify) | notify | | [nvim-semantic-tokens](https://github.com/theHamsta/nvim-semantic-tokens) | semantic_tokens | | [nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua) | nvimtree | | [nvim-treesitter-context](https://github.com/nvim-treesitter/nvim-treesitter-context) | treesitter_context | | [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) | treesitter | | [nvim-ts-rainbow](https://github.com/p00f/nvim-ts-rainbow) | ts_rainbow | | [overseer.nvim](https://github.com/stevearc/overseer.nvim) | overseer | | [pounce.nvim](https://github.com/rlane/pounce.nvim) | pounce | | [symbols-outline.nvim](https://github.com/simrat39/symbols-outline.nvim) | symbols_outline | | [telekasten.nvim](https://github.com/renerocksai/telekasten.nvim) | telekasten | | [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) | telescope | | [trouble.nvim](https://github.com/folke/trouble.nvim) | lsp_trouble | | [vim-airline](https://github.com/vim-airline/vim-airline) | Special | | [vim-clap](https://github.com/liuchengxu/vim-clap) | Special | | [vim-gitgutter](https://github.com/airblade/vim-gitgutter) | gitgutter | | [vim-illuminate](https://github.com/RRethy/vim-illuminate) | illuminate | | [vim-sneak](https://github.com/justinmk/vim-sneak) | vim_sneak | | [vimwiki](https://github.com/vimwiki/vimwiki) | vimwiki | | [which-key.nvim](https://github.com/folke/which-key.nvim) | which_key | > "Special" module means Special integrations, see 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: ```lua require("catppuccin").setup({ integrations = { = } }) ```
Click here to see an example config ```lua 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", }, }, }) ```
## Special integrations
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 ```lua 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: ```lua 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](https://github.com/kyazdani42/nvim-web-devicons/) plugin is installed. Then update your Feline config to use the Catppuccin components: ```lua 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: ```lua local clrs = require("catppuccin.palettes").get_palette() local ctp_feline = require('catppuccin.groups.integrations.feline') local U = require "catppuccin.utils.colors" 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 = U.vary_color({ latte = latte.base }, clrs.surface0), bkg = U.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](https://github.com/feline-nvim/feline.nvim/issues/302). In order for `:Catppuccin ` to work you could add this autocmd as a workaround: ```lua 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` ```lua fidget = true ``` Then set `window.blend` to `0`: ```lua 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](https://github.com/lukas-reineke/indent-blankline.nvim#with-custom-gindent_blankline_char_highlight_list) to set the latter up. ```lua 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): ```vim let g:lightline = {'colorscheme': 'catppuccin'} ```
lspsaga.nvim For custom Lsp Kind Icon and Color ```lua require("lspsaga").init_lsp_saga { custom_kind = require("catppuccin.groups.integrations.lsp_saga").custom_kind(), } ```
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): ```lua require('lualine').setup { options = { theme = "catppuccin" -- ... the rest of your lualine config } } ```
nvim-dap & nvim-dap-ui Setting `enabled` to `true`: ```lua integration = { dap = { enabled = true, enable_ui = true, -- enable nvim-dap-ui } } ``` ```lua -- 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)). ```lua 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`: ```lua navic = { enabled = false, custom_bg = "NONE", }, ``` ```lua -- You NEED to enable highlight in nvim-navic setting or it won't work require("nvim-navic").setup { highlight = true } ```
vim-airline Use this to set it up (**Note**: `catppuccin` is the only valid colorscheme name. It will pick the one set in your config): ```vim let g:airline_theme = 'catppuccin' ```
vim-clap Use this to set it up: ```vim 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/`](https://github.com/catppuccin/nvim/tree/main/lua/catppuccin/groups/integrations). # Compile > **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. ## Config By default catppuccin writes the compiled results into the system's cache directory. You can change the cache dir using: ```lua require("catppuccin").setup({ -- Note: On windows we replace `/` with `\` by default compile_path = vim.fn.stdpath "cache" .. "/catppuccin" }) ``` ## Compile commands ```vim :CatppuccinCompile " Create/update the compile file ``` ```lua require('catppuccin').compile() -- Catppuccin also provide a function to work with the catppuccin compiler. ``` ## Hooks 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: ```lua 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 }) ``` # FAQ ## Switch Catppuccin flavour on the fly ```lua :Catppuccin mocha/macchiato/frappe/latte ``` > **Note**: the command has autocompletion enabled, so you can just press tab to cycle through the flavours ## Load other custom highlights later ```lua require("catppuccin.lib.highlighter").syntax() ``` For example: ```lua 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`) ## Wrong treesitter highlights Please disable `additional_vim_regex_highlighting` ```lua 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: - Unsupported terminal: Terminal.app (macOS), Terminus, Terminology, ... Full list of Unsupported terminals can be found here: # Thanks to - [Pocco81](https://github.com/Pocco81) - [Null Chilly](https://github.com/nullchilly)  

Copyright © 2021-present Catppuccin Org