From 488bf61523bbfc5bcc4525d8ed335f996d4b866c Mon Sep 17 00:00:00 2001 From: Nicolas Goudry Date: Sun, 9 Jun 2024 23:33:25 +0200 Subject: [PATCH] feat(plugins): add smart-splits --- plugins/smart-splits.nix | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 plugins/smart-splits.nix diff --git a/plugins/smart-splits.nix b/plugins/smart-splits.nix new file mode 100644 index 0000000..5396cd8 --- /dev/null +++ b/plugins/smart-splits.nix @@ -0,0 +1,63 @@ +_: + +{ + opts = { + enable = true; + + settings = { + ignored_filetypes = [ "nofile" "quickfix" "qf" "prompt" ]; + ignored_buftypes = [ "nofile" ]; + }; + }; + + rootOpts.keymaps = [ + { + mode = "n"; + key = ""; + action.__raw = "function() require('smart-splits').move_cursor_left() end"; + options.desc = "Move to left split"; + } + { + mode = "n"; + key = ""; + action.__raw = "function() require('smart-splits').move_cursor_down() end"; + options.desc = "Move to below split"; + } + { + mode = "n"; + key = ""; + action.__raw = "function() require('smart-splits').move_cursor_up() end"; + options.desc = "Move to above split"; + } + { + mode = "n"; + key = ""; + action.__raw = "function() require('smart-splits').move_cursor_right() end"; + options.desc = "Move to right split"; + } + { + mode = "n"; + key = ""; + action.__raw = "function() require('smart-splits').resize_up() end"; + options.desc = "Resize split up"; + } + { + mode = "n"; + key = ""; + action.__raw = "function() require('smart-splits').resize_down() end"; + options.desc = "Resize split down"; + } + { + mode = "n"; + key = ""; + action.__raw = "function() require('smart-splits').resize_left() end"; + options.desc = "Resize split left"; + } + { + mode = "n"; + key = ""; + action.__raw = "function() require('smart-splits').resize_right() end"; + options.desc = "Resize split right"; + } + ]; +}