nixvim/plugins/smart-splits: init

This commit is contained in:
Gabriel Arazas 2024-02-14 18:28:01 +08:00
parent ce14a15863
commit 0c1850d8b0
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 36 additions and 0 deletions

View File

@ -4,6 +4,7 @@
./plugins/firenvim.nix ./plugins/firenvim.nix
./plugins/lush-nvim.nix ./plugins/lush-nvim.nix
./plugins/nvim-config-local.nix ./plugins/nvim-config-local.nix
./plugins/smart-splits.nix
./tinted-theming.nix ./tinted-theming.nix
]; ];
} }

View File

@ -0,0 +1,35 @@
{ config, lib, pkgs, helpers, ... }:
let
cfg = config.plugins.smart-splits;
in
{
options.plugins.smart-splits = {
enable = lib.mkEnableOption "smart-splits.nvim";
package = helpers.mkPackageOption "smart-splits.nvim" pkgs.vimPlugins.smart-splits-nvim;
settings = helpers.mkSettingsOption {
description = ''
Configuration to be passed as argument to `setup` function of the
plugin.
'';
example = {
resize_mode = {
quit_key = "<ESC>";
resize_keys = [ "h" "j" "k" "l" ];
silent = true;
};
ignored_events = [ "BufEnter" "WinEnter" ];
};
};
};
config = lib.mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraConfigLua = ''
require('smart-splits').setup(${helpers.toLuaObject cfg.settings})
'';
};
}