2023-02-01 20:11:37 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 01:50:27 +01:00
|
|
|
}: let
|
2024-03-12 01:47:41 +01:00
|
|
|
inherit (lib.modules) mkIf mkMerge;
|
|
|
|
inherit (lib.nvim.binds) mkLuaBinding mkBinding pushDownDefault;
|
|
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
2024-04-27 01:25:55 +02:00
|
|
|
inherit (lib.nvim.lua) toLuaObject;
|
2023-11-07 01:50:27 +01:00
|
|
|
|
2023-02-01 20:11:37 +01:00
|
|
|
cfg = config.vim.tabline.nvimBufferline;
|
2024-03-12 01:47:41 +01:00
|
|
|
|
|
|
|
self = import ./nvim-bufferline.nix {inherit lib;};
|
|
|
|
inherit (self.options.vim.tabline.nvimBufferline) mappings;
|
2023-02-01 20:11:37 +01:00
|
|
|
in {
|
2024-04-27 01:25:55 +02:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
vim = {
|
|
|
|
startPlugins = [
|
|
|
|
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
|
|
|
|
"bufdelete-nvim"
|
|
|
|
];
|
2023-02-01 20:11:37 +01:00
|
|
|
|
2024-04-27 01:25:55 +02:00
|
|
|
binds.whichKey.register = pushDownDefault {
|
|
|
|
"<leader>b" = "+Buffer";
|
|
|
|
"<leader>bm" = "BufferLineMove";
|
|
|
|
"<leader>bs" = "BufferLineSort";
|
|
|
|
"<leader>bsi" = "BufferLineSortById";
|
2024-03-12 01:47:41 +01:00
|
|
|
};
|
2024-04-27 01:25:55 +02:00
|
|
|
|
|
|
|
luaConfigRC.nvimBufferline = entryAnywhere ''
|
|
|
|
require("bufferline").setup({options = ${toLuaObject cfg.setupOpts}})
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2023-02-01 20:11:37 +01:00
|
|
|
}
|