Skip to content

Commit

Permalink
feat: add ability to toggle default integrations (#687)
Browse files Browse the repository at this point in the history
* feat: no_defaults option to disable all defaults

* feat no_defaults update readme

* docs: auto generate vimdoc

* `no_defaults` -> `default_integrations`

* docs: auto generate vimdoc

* fix stylua

* nil -> {}

---------

Co-authored-by: RAV64 <RAV64@users.noreply.github.com>
Co-authored-by: mrtnvgr <root@unixis.fun>
Co-authored-by: mrtnvgr <mrtnvgr@users.noreply.github.com>
Co-authored-by: mrtnvgr <martynovegorOF@yandex.ru>
  • Loading branch information
5 people committed Mar 27, 2024
1 parent 07679af commit e60e400
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -123,6 +123,7 @@ require("catppuccin").setup({
},
color_overrides = {},
custom_highlights = {},
default_integrations = true,
integrations = {
cmp = true,
gitsigns = true,
Expand Down Expand Up @@ -253,6 +254,14 @@ require("catppuccin").setup({
})
```

Some integrations are enabled by default, you can control this behaviour with `default_integrations` option.

```lua
require("catppuccin").setup({
default_integrations = false,
})
```

Below is a list of supported plugins and their corresponding integration module.

> [!Important]
Expand Down
10 changes: 10 additions & 0 deletions doc/catppuccin.txt
Expand Up @@ -104,6 +104,7 @@ options and settings.
},
color_overrides = {},
custom_highlights = {},
default_integrations = true,
integrations = {
cmp = true,
gitsigns = true,
Expand Down Expand Up @@ -246,6 +247,15 @@ example:
})
<

Some integrations are enabled by default, you can control this behaviour with
`default_integrations` option.

>lua
require("catppuccin").setup({
default_integrations = false,
})
<

Below is a list of supported plugins and their corresponding integration
module.

Expand Down
4 changes: 4 additions & 0 deletions lua/catppuccin/init.lua
Expand Up @@ -35,6 +35,7 @@ local M = {
types = {},
operators = {},
},
default_integrations = true,
integrations = {
alpha = true,
cmp = true,
Expand Down Expand Up @@ -165,6 +166,9 @@ function M.setup(user_conf)
did_setup = true
-- Parsing user config
user_conf = user_conf or {}

if user_conf.default_integrations == false then M.default_options.integrations = {} end

M.options = vim.tbl_deep_extend("keep", user_conf, M.default_options)
M.options.highlight_overrides.all = user_conf.custom_highlights or M.options.highlight_overrides.all

Expand Down
2 changes: 2 additions & 0 deletions lua/catppuccin/types.lua
Expand Up @@ -31,6 +31,8 @@
---@field no_underline boolean?
-- Handles the style of general hl groups (see `:h highlight-groups`).
---@field styles CtpStyles?
-- Should default integrations be used.
---@field default_integrations boolean?
-- Toggle integrations. Integrations allow Catppuccin to set the theme of various plugins.
---@field integrations CtpIntegrations?
-- Catppuccin colors can be overwritten here.
Expand Down

0 comments on commit e60e400

Please sign in to comment.