1
+ {
2
+ keymaps = [
3
+ # Custom/special keymaps
4
+ {
5
+ mode = "n" ;
6
+ key = "<leader>c" ;
7
+ action = "<cmd>sp<CR> <cmd>term<CR> <cmd>resize 20N<CR> i" ;
8
+ options = {
9
+ silent = true ;
10
+ desc = "Open terminal in split and resize" ;
11
+ } ;
12
+ }
13
+ {
14
+ mode = "n" ;
15
+ key = "<leader>h" ;
16
+ action = "<cmd>nohl<CR>" ;
17
+ options = {
18
+ silent = true ;
19
+ desc = "Clear search highlight" ;
20
+ } ;
21
+ }
22
+ {
23
+ mode = "n" ;
24
+ key = "<leader>z" ;
25
+ action = "<cmd>ZenMode<CR><cmd>set wrap<CR><cmd>set linebreak<CR>" ;
26
+ options = {
27
+ silent = true ;
28
+ desc = "Enable ZenMode with wrap and linebreak" ;
29
+ } ;
30
+ }
31
+ {
32
+ mode = "n" ;
33
+ key = "<leader>Z" ;
34
+ action = "<cmd>ZenMode<CR><cmd>set nowrap<CR><cmd>set nolinebreak<CR>" ;
35
+ options = {
36
+ silent = true ;
37
+ desc = "Enable ZenMode without wrap and linebreak" ;
38
+ } ;
39
+ }
40
+ {
41
+ mode = "n" ;
42
+ key = "<C-c>" ;
43
+ action = "<cmd>Telescope colorscheme<CR>" ;
44
+ options = {
45
+ silent = true ;
46
+ desc = "Open Telescope colorscheme picker" ;
47
+ } ;
48
+ }
49
+ {
50
+ mode = "n" ;
51
+ key = "<C-q>" ;
52
+ action = "<cmd>wqa<CR>" ;
53
+ options = {
54
+ silent = true ;
55
+ desc = "Save all and quit" ;
56
+ } ;
57
+ }
58
+ {
59
+ mode = "n" ;
60
+ key = "<C-s>" ;
61
+ action = "<cmd>w<CR>" ;
62
+ options = {
63
+ silent = true ;
64
+ desc = "Save file" ;
65
+ } ;
66
+ }
67
+ {
68
+ mode = "n" ;
69
+ key = "U" ;
70
+ action = "<cmd>redo<CR>" ;
71
+ options = {
72
+ silent = true ;
73
+ desc = "Redo last undone change" ;
74
+ } ;
75
+ }
76
+
77
+ # Window management
78
+ {
79
+ mode = "n" ;
80
+ key = "<leader>vs" ;
81
+ action = "<cmd>vs<CR>" ;
82
+ options = {
83
+ silent = true ;
84
+ desc = "Vertical split" ;
85
+ } ;
86
+ }
87
+ {
88
+ mode = "n" ;
89
+ key = "<leader>hs" ;
90
+ action = "<cmd>sp<CR>" ;
91
+ options = {
92
+ silent = true ;
93
+ desc = "Horizontal split" ;
94
+ } ;
95
+ }
96
+ {
97
+ mode = "n" ;
98
+ key = "<leader>tn" ;
99
+ action = "<cmd>tabnew<CR>" ;
100
+ options = {
101
+ silent = true ;
102
+ desc = "Open new tab" ;
103
+ } ;
104
+ }
105
+ {
106
+ mode = "n" ;
107
+ key = "<leader>th" ;
108
+ action = "<cmd>tabprev<CR>" ;
109
+ options = {
110
+ silent = true ;
111
+ desc = "Go to previous tab" ;
112
+ } ;
113
+ }
114
+ {
115
+ mode = "n" ;
116
+ key = "<leader>tj" ;
117
+ action = "<cmd>tabprev<CR>" ;
118
+ options = {
119
+ silent = true ;
120
+ desc = "Go to previous tab" ;
121
+ } ;
122
+ }
123
+ {
124
+ mode = "n" ;
125
+ key = "<leader>tk" ;
126
+ action = "<cmd>tabnext<CR>" ;
127
+ options = {
128
+ silent = true ;
129
+ desc = "Go to next tab" ;
130
+ } ;
131
+ }
132
+ {
133
+ mode = "n" ;
134
+ key = "<leader>tl" ;
135
+ action = "<cmd>tabnext<CR>" ;
136
+ options = {
137
+ silent = true ;
138
+ desc = "Go to next tab" ;
139
+ } ;
140
+ }
141
+ {
142
+ mode = "n" ;
143
+ key = "<leader>to" ;
144
+ action = "<cmd>tabo<CR>" ;
145
+ options = {
146
+ silent = true ;
147
+ desc = "Close all other tabs" ;
148
+ } ;
149
+ }
150
+ {
151
+ mode = "n" ;
152
+ key = "<leader>tc" ;
153
+ action = "<cmd>tabc<CR>" ;
154
+ options = {
155
+ silent = true ;
156
+ desc = "Close current tab" ;
157
+ } ;
158
+ }
159
+
160
+ # Window navigation
161
+ {
162
+ mode = "n" ;
163
+ key = "<C-Tab>" ;
164
+ action = "<C-w>w" ;
165
+ options = {
166
+ silent = true ;
167
+ desc = "Cycle through windows" ;
168
+ } ;
169
+ }
170
+ {
171
+ mode = "n" ;
172
+ key = "<C-h>" ;
173
+ action = "<C-w>h" ;
174
+ options = {
175
+ silent = true ;
176
+ desc = "Move to the left window" ;
177
+ } ;
178
+ }
179
+ {
180
+ mode = "n" ;
181
+ key = "<C-j>" ;
182
+ action = "<C-w>j" ;
183
+ options = {
184
+ silent = true ;
185
+ desc = "Move to the bottom window" ;
186
+ } ;
187
+ }
188
+ {
189
+ mode = "n" ;
190
+ key = "<C-k>" ;
191
+ action = "<C-w>k" ;
192
+ options = {
193
+ silent = true ;
194
+ desc = "Move to the top window" ;
195
+ } ;
196
+ }
197
+ {
198
+ mode = "n" ;
199
+ key = "<C-l>" ;
200
+ action = "<C-w>l" ;
201
+ options = {
202
+ silent = true ;
203
+ desc = "Move to the right window" ;
204
+ } ;
205
+ }
206
+
207
+ # Buffer navigation
208
+ {
209
+ mode = "n" ;
210
+ key = "<S-l>" ;
211
+ action = "<cmd>bnext<CR>" ;
212
+ options = {
213
+ silent = true ;
214
+ desc = "Go to next buffer" ;
215
+ } ;
216
+ }
217
+ {
218
+ mode = "n" ;
219
+ key = "<S-h>" ;
220
+ action = "<cmd>bprevious<CR>" ;
221
+ options = {
222
+ silent = true ;
223
+ desc = "Go to previous buffer" ;
224
+ } ;
225
+ }
226
+
227
+ # Stay in visual mode when indenting
228
+ {
229
+ mode = "v" ;
230
+ key = "<" ;
231
+ action = "<gv" ;
232
+ options = {
233
+ silent = true ;
234
+ desc = "Indent left and stay in visual mode" ;
235
+ } ;
236
+ }
237
+ {
238
+ mode = "v" ;
239
+ key = ">" ;
240
+ action = ">gv" ;
241
+ options = {
242
+ silent = true ;
243
+ desc = "Indent right and stay in visual mode" ;
244
+ } ;
245
+ }
246
+
247
+ # Move by physical lines
248
+ {
249
+ mode = "n" ;
250
+ key = "j" ;
251
+ action = "gj" ;
252
+ options = {
253
+ silent = true ;
254
+ desc = "Move down by visual line" ;
255
+ } ;
256
+ }
257
+ {
258
+ mode = "n" ;
259
+ key = "k" ;
260
+ action = "gk" ;
261
+ options = {
262
+ silent = true ;
263
+ desc = "Move up by visual line" ;
264
+ } ;
265
+ }
266
+
267
+ # NvimTree
268
+ {
269
+ mode = "n" ;
270
+ key = "<C-n>" ;
271
+ action = "<cmd>NvimTreeToggle<CR>" ;
272
+ options = {
273
+ silent = true ;
274
+ desc = "Toggle NvimTree" ;
275
+ } ;
276
+ }
277
+
278
+ # Telescope
279
+ {
280
+ mode = "n" ;
281
+ key = "<C-f>" ;
282
+ action = "<cmd>lua require('telescope.builtin').find_files()<CR>" ;
283
+ options = {
284
+ silent = true ;
285
+ desc = "Find files with Telescope" ;
286
+ } ;
287
+ }
288
+ {
289
+ mode = "n" ;
290
+ key = "<leader>ff" ;
291
+ action = "<cmd>lua require('telescope.builtin').find_files()<CR>" ;
292
+ options = {
293
+ silent = true ;
294
+ desc = "Find files with Telescope" ;
295
+ } ;
296
+ }
297
+ {
298
+ mode = "n" ;
299
+ key = "<leader>fg" ;
300
+ action = "<cmd>lua require('telescope.builtin').live_grep()<CR>" ;
301
+ options = {
302
+ silent = true ;
303
+ desc = "Live grep with Telescope" ;
304
+ } ;
305
+ }
306
+ {
307
+ mode = "n" ;
308
+ key = "<leader>fb" ;
309
+ action = "<cmd>lua require('telescope.builtin').buffers()<CR>" ;
310
+ options = {
311
+ silent = true ;
312
+ desc = "Search buffers with Telescope" ;
313
+ } ;
314
+ }
315
+ {
316
+ mode = "n" ;
317
+ key = "<leader>fh" ;
318
+ action = "<cmd>lua require('telescope.builtin').help_tags()<CR>" ;
319
+ options = {
320
+ silent = true ;
321
+ desc = "Search help tags with Telescope" ;
322
+ } ;
323
+ }
324
+
325
+ # Easy alignment
326
+ {
327
+ mode = "n" ;
328
+ key = "ga" ;
329
+ action = ":EasyAlign" ;
330
+ options = {
331
+ silent = true ;
332
+ desc = "EasyAlign in normal mode" ;
333
+ } ;
334
+ }
335
+ {
336
+ mode = "v" ;
337
+ key = "ga" ;
338
+ action = ":EasyAlign" ;
339
+ options = {
340
+ silent = true ;
341
+ desc = "EasyAlign in visual mode" ;
342
+ } ;
343
+ }
344
+ ] ;
345
+ }
0 commit comments