From 45b4f0b31931f14e01eec8522067b75b09d476c5 Mon Sep 17 00:00:00 2001 From: Venkatesan Ravi Date: Fri, 4 Apr 2025 01:13:09 +0000 Subject: [PATCH] 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.