add smart splits

This commit is contained in:
♥ Minnie ♥ 2025-05-19 09:37:24 +08:00
parent 1e9e412a02
commit e8ff6ac5f3
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
3 changed files with 111 additions and 36 deletions

View file

@ -0,0 +1,110 @@
{...}: {
plugins.smart-splits = {
enable = true;
settings = {
multiplexer_integration = "WezTerm";
};
};
keymaps = [
# moving between splits
{
mode = ["n"];
key = "<C-Left>";
action = {
__raw = "require('smart-splits').move_cursor_left";
};
}
{
mode = ["n"];
key = "<C-Down>";
action = {
__raw = "require('smart-splits').move_cursor_down";
};
}
{
mode = ["n"];
key = "<C-Up>";
action = {
__raw = "require('smart-splits').move_cursor_up";
};
}
{
mode = ["n"];
key = "<C-Right>";
action = {
__raw = "require('smart-splits').move_cursor_right";
};
}
# swapping buffers between windows
{
mode = ["n"];
key = "<C-S-Left>";
action = {
__raw = "require('smart-splits').swap_buf_left";
};
}
{
mode = ["n"];
key = "<C-S-Down>";
action = {
__raw = "require('smart-splits').swap_buf_down";
};
}
{
mode = ["n"];
key = "<C-S-Up>";
action = {
__raw = "require('smart-splits').swap_buf_up";
};
}
{
mode = ["n"];
key = "<C-S-Right>";
action = {
__raw = "require('smart-splits').swap_buf_right";
};
}
# resizing splits
{
mode = ["n"];
key = "<C-A-Left>";
action = {
__raw = "require('smart-splits').resize_left";
};
}
{
mode = ["n"];
key = "<C-A-Down>";
action = {
__raw = "require('smart-splits').resize_down";
};
}
{
mode = ["n"];
key = "<C-A-Up>";
action = {
__raw = "require('smart-splits').resize_up";
};
}
{
mode = ["n"];
key = "<C-A-Right>";
action = {
__raw = "require('smart-splits').resize_right";
};
}
];
}