From 94b58381755b0329e2aa29f0766d4553c84e0aed Mon Sep 17 00:00:00 2001 From: Venkatesan Ravi Date: Thu, 3 Apr 2025 06:27:59 -0700 Subject: [PATCH 1/4] lsp/lsp-aga: add catppuccin integration (#779) Co-authored-by: raf --- docs/release-notes/rl-0.8.md | 1 + modules/plugins/lsp/lspsaga/lspsaga.nix | 29 ++++++++++++++++------ modules/plugins/theme/supported-themes.nix | 25 ++++++++++--------- 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 368df9f5..48d9e05f 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -292,6 +292,7 @@ - Add lint (luacheck) and formatting (stylua) support for Lua. - Add lint (markdownlint-cli2) support for Markdown. +- Add catppuccin integration for Lspsaga. [tebuevd](https://github.com/tebuevd): diff --git a/modules/plugins/lsp/lspsaga/lspsaga.nix b/modules/plugins/lsp/lspsaga/lspsaga.nix index 39ce6298..570cee1a 100644 --- a/modules/plugins/lsp/lspsaga/lspsaga.nix +++ b/modules/plugins/lsp/lspsaga/lspsaga.nix @@ -6,6 +6,19 @@ inherit (lib.modules) mkRemovedOptionModule; inherit (lib.options) mkOption mkEnableOption; inherit (lib.nvim.types) borderType mkPluginSetupOption; + inherit (lib.nvim.lua) mkLuaInline; + + uiKindSetupOpts = + if config.vim.theme.enable && config.vim.theme.name == "catppuccin" + then { + ui.kind = + mkLuaInline + # lua + '' + require("catppuccin.groups.integrations.lsp_saga").custom_kind() + ''; + } + else {}; in { imports = [ (mkRemovedOptionModule ["vim" "lsp" "lspsaga" "mappings"] '' @@ -21,12 +34,14 @@ in { options.vim.lsp.lspsaga = { enable = mkEnableOption "LSP Saga"; - setupOpts = mkPluginSetupOption "lspsaga" { - border_style = mkOption { - type = borderType; - default = config.vim.ui.borders.globalStyle; - description = "Border type, see {command}`:help nvim_open_win`"; - }; - }; + setupOpts = + mkPluginSetupOption "lspsaga" { + border_style = mkOption { + type = borderType; + default = config.vim.ui.borders.globalStyle; + description = "Border type, see {command}`:help nvim_open_win`"; + }; + } + // uiKindSetupOpts; }; } diff --git a/modules/plugins/theme/supported-themes.nix b/modules/plugins/theme/supported-themes.nix index 0b5cb90b..2b427871 100644 --- a/modules/plugins/theme/supported-themes.nix +++ b/modules/plugins/theme/supported-themes.nix @@ -66,21 +66,22 @@ in { transparent_background = ${boolToString transparent}, term_colors = true, integrations = { - nvimtree = { - enabled = true, - transparent_panel = ${boolToString transparent}, - show_root = true, - }, + nvimtree = { + enabled = true, + transparent_panel = ${boolToString transparent}, + show_root = true, + }, hop = true, - gitsigns = true, - telescope = true, - treesitter = true, + gitsigns = true, + telescope = true, + treesitter = true, treesitter_context = true, - ts_rainbow = true, + ts_rainbow = true, fidget = true, alpha = true, leap = true, + lsp_saga = true, markdown = true, noice = true, notify = true, -- nvim-notify @@ -106,9 +107,9 @@ in { style' = warnIf (style == "light") "oxocarbon: light theme is not well-supported" style; in '' - require('oxocarbon') - vim.opt.background = "${style'}" - vim.cmd.colorscheme = "oxocarbon" + require('oxocarbon') + vim.opt.background = "${style'}" + vim.cmd.colorscheme = "oxocarbon" ${optionalString transparent '' vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) From 45b4f0b31931f14e01eec8522067b75b09d476c5 Mon Sep 17 00:00:00 2001 From: Venkatesan Ravi Date: Fri, 4 Apr 2025 01:13:09 +0000 Subject: [PATCH 2/4] tabline/bufferline: add catppuccin integration --- docs/release-notes/rl-0.8.md | 2 +- .../plugins/tabline/nvim-bufferline/config.nix | 2 +- .../tabline/nvim-bufferline/nvim-bufferline.nix | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 48d9e05f..49bf4eb9 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -292,7 +292,7 @@ - Add lint (luacheck) and formatting (stylua) support for Lua. - Add lint (markdownlint-cli2) support for Markdown. -- Add catppuccin integration for Lspsaga. +- Add catppuccin integration for Bufferline, Lspsaga. [tebuevd](https://github.com/tebuevd): diff --git a/modules/plugins/tabline/nvim-bufferline/config.nix b/modules/plugins/tabline/nvim-bufferline/config.nix index 4989e991..965f81f0 100644 --- a/modules/plugins/tabline/nvim-bufferline/config.nix +++ b/modules/plugins/tabline/nvim-bufferline/config.nix @@ -9,7 +9,7 @@ inherit (lib.nvim.lua) toLuaObject; cfg = config.vim.tabline.nvimBufferline; - self = import ./nvim-bufferline.nix {inherit lib;}; + self = import ./nvim-bufferline.nix {inherit config lib;}; inherit (self.options.vim.tabline.nvimBufferline) mappings; in { config = mkIf cfg.enable { diff --git a/modules/plugins/tabline/nvim-bufferline/nvim-bufferline.nix b/modules/plugins/tabline/nvim-bufferline/nvim-bufferline.nix index dc32226e..5a4f1ff0 100644 --- a/modules/plugins/tabline/nvim-bufferline/nvim-bufferline.nix +++ b/modules/plugins/tabline/nvim-bufferline/nvim-bufferline.nix @@ -1,4 +1,8 @@ -{lib, ...}: let +{ + config, + lib, + ... +}: let inherit (lib.options) mkOption mkEnableOption literalExpression; inherit (lib.types) enum bool either nullOr str int listOf attrs; inherit (lib.generators) mkLuaInline; @@ -23,7 +27,14 @@ in { setupOpts = mkPluginSetupOption "Bufferline-nvim" { highlights = mkOption { type = either attrs luaInline; - default = {}; + default = + if config.vim.theme.enable && config.vim.theme.name == "catppuccin" + then + mkLuaInline + '' + require("catppuccin.groups.integrations.bufferline").get() + '' + else {}; description = '' Overrides the highlight groups of bufferline. From 68346ebedea3f33ca93cf9b77ca69562660faf2d Mon Sep 17 00:00:00 2001 From: rafiq Date: Fri, 4 Apr 2025 19:17:11 +0800 Subject: [PATCH 3/4] Merge pull request #787 from rrvsh/fix/pylsp-pkgs languages/python get python-lsp-server python3Packages --- docs/release-notes/rl-0.8.md | 4 ++++ modules/plugins/languages/python.nix | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 49bf4eb9..e8239681 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -308,3 +308,7 @@ - Fix oil config referencing snacks - Add [flash.nvim] plugin to `vim.utility.motion.flash-nvim` + +[rrvsh](https://github.com/rrvsh): + +- Fix namespace of python-lsp-server by changing it to python3Packages diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index ccb15f7c..476b56ef 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -47,7 +47,7 @@ }; python-lsp-server = { - package = pkgs.python-lsp-server; + package = pkgs.python3Packages.python-lsp-server; lspConfig = '' lspconfig.pylsp.setup{ capabilities = capabilities; From 072f7599ae68bd3c75eb36f8f23da79829f660b9 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 4 Apr 2025 16:45:05 +0300 Subject: [PATCH 4/4] treesitter: mention builtGrammars in grammars option --- modules/plugins/treesitter/treesitter.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/plugins/treesitter/treesitter.nix b/modules/plugins/treesitter/treesitter.nix index 322d2eb0..d88cc1a9 100644 --- a/modules/plugins/treesitter/treesitter.nix +++ b/modules/plugins/treesitter/treesitter.nix @@ -24,12 +24,19 @@ in { grammars = mkOption { type = listOf package; default = []; + example = literalExpression '' + pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ + regex + kdl + ]; + ''; description = '' - List of treesitter grammars to install. + List of treesitter grammars to install. For grammars to be installed properly, + you must use grammars from `pkgs.vimPlugins.nvim-treesitter.builtGrammars`. - For languages already supported by nvf, you may - use the {option}`vim.language..treesitter` options, which - will automatically add the required grammars to this. + For languages already supported by nvf, you may use + {option}`vim.language..treesitter` options, which will automatically add + the required grammars to this. ''; };