neovim-flake/modules/plugins/tabline/nvim-bufferline/config.nix
NotAShelf 4ee562d438 tabline/bufferline: convert to setupOpts
this is pretty much WIP and contains a bunch of bugs that I haven't tackled yet.
2024-06-15 02:41:50 +02:00

35 lines
937 B
Nix

{
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.binds) mkLuaBinding mkBinding pushDownDefault;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.tabline.nvimBufferline;
self = import ./nvim-bufferline.nix {inherit lib;};
inherit (self.options.vim.tabline.nvimBufferline) mappings;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
"bufdelete-nvim"
];
binds.whichKey.register = pushDownDefault {
"<leader>b" = "+Buffer";
"<leader>bm" = "BufferLineMove";
"<leader>bs" = "BufferLineSort";
"<leader>bsi" = "BufferLineSortById";
};
luaConfigRC.nvimBufferline = entryAnywhere ''
require("bufferline").setup({options = ${toLuaObject cfg.setupOpts}})
'';
};
};
}