feat(plugins): add smart-splits

This commit is contained in:
Nicolas Goudry 2024-06-09 23:33:25 +02:00
parent d91509cb1e
commit 488bf61523
No known key found for this signature in database
GPG key ID: 5FC434D9FFD1DF44

63
plugins/smart-splits.nix Normal file
View file

@ -0,0 +1,63 @@
_:
{
opts = {
enable = true;
settings = {
ignored_filetypes = [ "nofile" "quickfix" "qf" "prompt" ];
ignored_buftypes = [ "nofile" ];
};
};
rootOpts.keymaps = [
{
mode = "n";
key = "<C-H>";
action.__raw = "function() require('smart-splits').move_cursor_left() end";
options.desc = "Move to left split";
}
{
mode = "n";
key = "<C-J>";
action.__raw = "function() require('smart-splits').move_cursor_down() end";
options.desc = "Move to below split";
}
{
mode = "n";
key = "<C-K>";
action.__raw = "function() require('smart-splits').move_cursor_up() end";
options.desc = "Move to above split";
}
{
mode = "n";
key = "<C-L>";
action.__raw = "function() require('smart-splits').move_cursor_right() end";
options.desc = "Move to right split";
}
{
mode = "n";
key = "<C-Up>";
action.__raw = "function() require('smart-splits').resize_up() end";
options.desc = "Resize split up";
}
{
mode = "n";
key = "<C-Down>";
action.__raw = "function() require('smart-splits').resize_down() end";
options.desc = "Resize split down";
}
{
mode = "n";
key = "<C-Left>";
action.__raw = "function() require('smart-splits').resize_left() end";
options.desc = "Resize split left";
}
{
mode = "n";
key = "<C-Right>";
action.__raw = "function() require('smart-splits').resize_right() end";
options.desc = "Resize split right";
}
];
}