2024-02-14 10:28:01 +00:00
|
|
|
{ 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;
|
|
|
|
|
2024-02-14 22:42:26 +00:00
|
|
|
settings = lib.mkOption {
|
|
|
|
type = with lib.types; attrsOf anything;
|
|
|
|
default = { };
|
2024-02-14 10:28:01 +00:00
|
|
|
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})
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|