From 8bb460e261dd0fd8ac3f544f8a2a28ad64616cbe Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 14 Feb 2024 19:05:01 +0800 Subject: [PATCH] plugins/smart-splits: init --- plugins/default.nix | 1 + plugins/utils/smart-splits.nix | 23 ++++++++++++++++++ .../plugins/utils/smart-splits.nix | 24 +++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 plugins/utils/smart-splits.nix create mode 100644 tests/test-sources/plugins/utils/smart-splits.nix diff --git a/plugins/default.nix b/plugins/default.nix index 43afa312..ffccda3c 100644 --- a/plugins/default.nix +++ b/plugins/default.nix @@ -166,6 +166,7 @@ ./utils/quickmath.nix ./utils/refactoring.nix ./utils/rest.nix + ./utils/smart-splits.nix ./utils/specs.nix ./utils/spider.nix ./utils/startify.nix diff --git a/plugins/utils/smart-splits.nix b/plugins/utils/smart-splits.nix new file mode 100644 index 00000000..34f3f74b --- /dev/null +++ b/plugins/utils/smart-splits.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + pkgs, + helpers, + ... +}: +helpers.neovim-plugin.mkNeovimPlugin config { + name = "smart-splits"; + originalName = "smart-splits.nvim"; + defaultPackage = pkgs.vimPlugins.smart-splits-nvim; + + maintainers = [lib.maintainers.foo-dogsquared]; + + settingsExample = { + resize_mode = { + quit_key = ""; + resize_keys = ["h" "j" "k" "l"]; + silent = true; + }; + ignored_events = ["BufEnter" "WinEnter"]; + }; +} diff --git a/tests/test-sources/plugins/utils/smart-splits.nix b/tests/test-sources/plugins/utils/smart-splits.nix new file mode 100644 index 00000000..ea91a7d3 --- /dev/null +++ b/tests/test-sources/plugins/utils/smart-splits.nix @@ -0,0 +1,24 @@ +{ + empty = { + plugins.smart-splits.enable = true; + }; + + example = { + plugins.smart-splits = { + enable = true; + + settings = { + ignored_filetypes = ["nofile" "quickfix" "prompt"]; + ignored_buftypes = ["NvimTree"]; + default_amount = 3; + move_cursor_same_row = true; + cursor_follows_swapped_bufs = true; + resize_mode = { + quit_key = ""; + resize_keys = ["h" "j" "k" "l"]; + silent = true; + }; + }; + }; + }; +}