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