mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 08:39:50 +01:00
modules/tabline: switch to explicit lib calls
This commit is contained in:
parent
32c2e7733a
commit
e80f2c9280
4 changed files with 86 additions and 82 deletions
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./nvim-bufferline
|
||||
];
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkMerge mkLuaBinding mkBinding nvim pushDownDefault;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.binds) mkLuaBinding mkBinding pushDownDefault;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.tabline.nvimBufferline;
|
||||
self = import ./nvim-bufferline.nix {
|
||||
inherit lib;
|
||||
};
|
||||
mappings = self.options.vim.tabline.nvimBufferline.mappings;
|
||||
|
||||
self = import ./nvim-bufferline.nix {inherit lib;};
|
||||
inherit (self.options.vim.tabline.nvimBufferline) mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable (
|
||||
let
|
||||
|
@ -22,12 +23,13 @@ in {
|
|||
'';
|
||||
};
|
||||
in {
|
||||
vim.startPlugins = [
|
||||
(assert config.vim.visuals.nvimWebDevicons.enable == true; "nvim-bufferline-lua")
|
||||
vim = {
|
||||
startPlugins = [
|
||||
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
|
||||
"bufdelete-nvim"
|
||||
];
|
||||
|
||||
vim.maps.normal = mkMerge [
|
||||
maps.normal = mkMerge [
|
||||
(mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete" mappings.closeCurrent.description)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||
|
@ -40,14 +42,14 @@ in {
|
|||
(mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" mappings.movePrevious.description)
|
||||
];
|
||||
|
||||
vim.binds.whichKey.register = pushDownDefault {
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>b" = "+Buffer";
|
||||
"<leader>bm" = "BufferLineMove";
|
||||
"<leader>bs" = "BufferLineSort";
|
||||
"<leader>bsi" = "BufferLineSortById";
|
||||
};
|
||||
|
||||
vim.luaConfigRC.nvimBufferline = nvim.dag.entryAnywhere ''
|
||||
luaConfigRC.nvimBufferline = entryAnywhere ''
|
||||
require("bufferline").setup{
|
||||
options = {
|
||||
mode = "buffers",
|
||||
|
@ -98,6 +100,7 @@ in {
|
|||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./nvim-bufferline.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkMappingOption;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
in {
|
||||
options.vim.tabline.nvimBufferline = {
|
||||
enable = mkEnableOption "nvim-bufferline-lua as a bufferline";
|
||||
enable = mkEnableOption "neovim bufferline";
|
||||
|
||||
mappings = {
|
||||
closeCurrent = mkMappingOption "Close buffer" null;
|
||||
|
|
Loading…
Reference in a new issue