diff --git a/modules/nixvim/default.nix b/modules/nixvim/default.nix index 3213a085..854954de 100644 --- a/modules/nixvim/default.nix +++ b/modules/nixvim/default.nix @@ -4,6 +4,7 @@ ./plugins/firenvim.nix ./plugins/lush-nvim.nix ./plugins/nvim-config-local.nix + ./plugins/smart-splits.nix ./tinted-theming.nix ]; } diff --git a/modules/nixvim/plugins/smart-splits.nix b/modules/nixvim/plugins/smart-splits.nix new file mode 100644 index 00000000..455f7bed --- /dev/null +++ b/modules/nixvim/plugins/smart-splits.nix @@ -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 = ""; + 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}) + ''; + }; +}