-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplits.nix
137 lines (134 loc) · 3.08 KB
/
splits.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{
config,
lib,
pkgs,
...
}: {
extraPlugins = with pkgs.vimPlugins; [
{
plugin = bufresize-nvim;
config = ''lua require('bufresize').setup()'';
}
];
extraConfigLua = ''
require('smart-splits').setup({
resize_mode = {
hooks = {
on_leave = require('bufresize').register,
},
},
})
'';
keymaps = lib.optionals config.plugins.smart-splits.enable [
{
mode = "n";
key = "<C-h>";
action = "<Cmd>lua require('smart-splits').move_cursor_left({ at_edge = 'stop' })<CR>";
options = {
desc = "Navigate left split";
silent = true;
};
}
{
mode = "n";
key = "<C-j>";
action = "<Cmd>lua require('smart-splits').move_cursor_down({ at_edge = 'stop' })<CR>";
options = {
desc = "Navigate down split";
silent = true;
};
}
{
mode = "n";
key = "<C-k>";
action = "<Cmd>lua require('smart-splits').move_cursor_up({ at_edge = 'stop' })<CR>";
options = {
desc = "Navigate up split";
silent = true;
};
}
{
mode = "n";
key = "<C-l>";
action = "<Cmd>lua require('smart-splits').move_cursor_right({ at_edge = 'stop' })<CR>";
options = {
desc = "Navigate right split";
silent = true;
};
}
{
mode = "n";
key = "<C-\\\\>";
action = "<Cmd>lua require('smart-splits').move_cursor_previous())<CR>";
options = {
desc = "Navigate previous split";
silent = true;
};
}
{
mode = "n";
key = "<A-h>";
action = "<Cmd>lua require('smart-splits').resize_left()<CR>";
options = {
desc = "Resize split left";
silent = true;
};
}
{
mode = "n";
key = "<A-j>";
action = "<Cmd>lua require('smart-splits').resize_down()<CR>";
options = {
desc = "Resize split down";
silent = true;
};
}
{
mode = "n";
key = "<A-k>";
action = "<Cmd>lua require('smart-splits').resize_up()<CR>";
options = {
desc = "Resize split up";
silent = true;
};
}
{
mode = "n";
key = "<A-l>";
action = "<Cmd>lua require('smart-splits').resize_right()<CR>";
options = {
desc = "Resize split right";
silent = true;
};
}
];
plugins = {
smart-splits = {
enable = true;
settings = {
at_edge = "stop";
default_amount = 3;
disable_multiplexer_nav_when_zoomed = true;
float_win_behavior = "previous";
ignored_buftypes = [
"nofile"
"quickfix"
"prompt"
];
ignored_events = [
"BufEnter"
"WinEnter"
];
ignored_filetypes = lib.optional config.plugins.neo-tree.enable "neotree";
log_level = "info";
move_cursor_same_row = false;
multiplexer_integration = true;
resize_mode = {
quit_key = "<Esc>";
resize_keys = ["h" "j" "k" "l"];
silent = true;
};
};
};
};
}