forked from ChristianChiarulli/nvim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
whichkey.lua
477 lines (451 loc) · 19.4 KB
/
whichkey.lua
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
local status_ok, which_key = pcall(require, "which-key")
if not status_ok then
return
end
local setup = {
plugins = {
marks = true, -- shows a list of your marks on ' and `
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
spelling = {
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
suggestions = 20, -- how many suggestions should be shown in the list?
},
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
-- No actual key bindings are created
presets = {
operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion
motions = false, -- adds help for motions
text_objects = false, -- help for text objects triggered after entering an operator
windows = true, -- default bindings on <c-w>
nav = true, -- misc bindings to work with windows
z = true, -- bindings for folds, spelling and others prefixed with z
g = true, -- bindings for prefixed with g
},
},
-- add operators that will trigger motion and text object completion
-- to enable all native operators, set the preset / operators plugin above
-- operators = { gc = "Comments" },
key_labels = {
-- override the label used to display some keys. It doesn't effect WK in any other way.
-- For example:
-- ["<space>"] = "SPC",
["<leader>"] = "SPC",
-- ["<cr>"] = "RET",
-- ["<tab>"] = "TAB",
},
icons = {
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
separator = "➜", -- symbol used between a key and it's label
group = "+", -- symbol prepended to a group
},
popup_mappings = {
scroll_down = "<c-d>", -- binding to scroll down inside the popup
scroll_up = "<c-u>", -- binding to scroll up inside the popup
},
window = {
border = "rounded", -- none, single, double, shadow
position = "bottom", -- bottom, top
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
winblend = 0,
},
layout = {
height = { min = 4, max = 25 }, -- min and max height of the columns
width = { min = 20, max = 50 }, -- min and max width of the columns
spacing = 3, -- spacing between columns
align = "center", -- align columns left, center or right
},
ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
show_help = false, -- show help message on the command line when the popup is visible
-- triggers = "auto", -- automatically setup triggers
-- triggers = {"<leader>"} -- or specify a list manually
triggers_blacklist = {
-- list of mode / prefixes that should never be hooked by WhichKey
-- this is mostly relevant for key maps that start with a native binding
-- most people should not need to change this
i = { "j", "k" },
v = { "j", "k" },
},
}
local opts = {
mode = "n", -- NORMAL mode
prefix = "<leader>",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps
nowait = true, -- use `nowait` when creating keymaps
}
local m_opts = {
mode = "n", -- NORMAL mode
prefix = "m",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps
nowait = true, -- use `nowait` when creating keymaps
}
local m_mappings = {
a = { "<cmd>silent BookmarkAnnotate<cr>", "Annotate" },
c = { "<cmd>silent BookmarkClear<cr>", "Clear" },
b = { "<cmd>silent BookmarkToggle<cr>", "Toggle" },
m = { '<cmd>lua require("harpoon.mark").add_file()<cr>', "Harpoon" },
["."] = { '<cmd>lua require("harpoon.ui").nav_next()<cr>', "Harpoon Next" },
[","] = { '<cmd>lua require("harpoon.ui").nav_prev()<cr>', "Harpoon Prev" },
l = { "<cmd>lua require('user.bfs').open()<cr>", "Buffers" },
j = { "<cmd>silent BookmarkNext<cr>", "Next" },
s = { "<cmd>Telescope harpoon marks<cr>", "Search Files" },
k = { "<cmd>silent BookmarkPrev<cr>", "Prev" },
S = { "<cmd>silent BookmarkShowAll<cr>", "Prev" },
-- s = {
-- "<cmd>lua require('telescope').extensions.vim_bookmarks.all({ hide_filename=false, prompt_title=\"bookmarks\", shorten_path=false })<cr>",
-- "Show",
-- },
x = { "<cmd>BookmarkClearAll<cr>", "Clear All" },
[";"] = { '<cmd>lua require("harpoon.ui").toggle_quick_menu()<cr>', "Harpoon UI" },
}
local mappings = {
-- ["1"] = "which_key_ignore",
-- a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Action" },
A = {
name = "AutoRunner",
r = { "<cmd>AutoRunnerRun<cr>", "Run the command" },
t = { "<cmd>AutoRunnerToggle<cr>", "Toggle output window" },
e = { "<cmd>AutoRunnerEditFile<cr>", "Edit build file/command (if available)" },
a = { "<cmd>AutoRunnerAddCommand<cr>", "Add/change command" },
c = { "<cmd>AutoRunnerClearBuffer<cr>", "Clear buffer" },
C = { "<cmd>AutoRunnerClearAll<cr>", "Clear all (command and buffers)" },
p = { "<cmd>AutoRunnerPrintCommand<cr>", "Print command" },
},
a = {
name = "AutoRunnerTerm",
r = { "<cmd>AutoRunnerTermRun<cr>", "Run the command" },
t = { "<cmd>AutoRunnerTermToggle<cr>", "Toggle output window" },
e = { "<cmd>AutoRunnerEditFile<cr>", "Edit build file/command (if available)" },
a = { "<cmd>AutoRunnerAddCommand<cr>", "Add/change command" },
p = { "<cmd>AutoRunnerPrintCommand<cr>", "Print command" },
},
b = { "<cmd>Telescope buffers<cr>", "Buffers" },
e = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
-- v = { "<cmd>vsplit<cr>", "vsplit" },
-- s = { "<cmd>split<cr>", "split" },
w = { "<cmd>w<CR>", "Write" },
h = { "<cmd>nohlsearch<CR>", "No HL" },
q = { '<cmd>lua require("user.functions").smart_quit()<CR>', "Quit" },
["/"] = { '<cmd>lua require("Comment.api").toggle.linewise.current()<CR>', "Comment" },
-- ["c"] = { "<cmd>Bdelete!<CR>", "Close Buffer" },
c = { "<cmd>Bdelete!<CR>", "Close Buffer" },
-- :lua require'lir.float'.toggle()
-- ["f"] = {
-- },
-- ["F"] = { "<cmd>Telescope live_grep theme=ivy<cr>", "Find Text" },
-- P = { "<cmd>lua require('telescope').extensions.projects.projects()<cr>", "Projects" },
-- ["R"] = { '<cmd>lua require("renamer").rename()<cr>', "Rename" },
-- ["z"] = { "<cmd>ZenMode<cr>", "Zen" },
["gy"] = "Link",
B = {
name = "Browse",
i = { "<cmd>BrowseInputSearch<cr>", "Input Search" },
b = { "<cmd>Browse<cr>", "Browse" },
d = { "<cmd>BrowseDevdocsSearch<cr>", "Devdocs" },
f = { "<cmd>BrowseDevdocsFiletypeSearch<cr>", "Devdocs Filetype" },
m = { "<cmd>BrowseMdnSearch<cr>", "Mdn" },
},
p = {
name = "Packer",
c = { "<cmd>PackerCompile<cr>", "Compile" },
i = { "<cmd>PackerInstall<cr>", "Install" },
s = { "<cmd>PackerSync<cr>", "Sync" },
S = { "<cmd>PackerStatus<cr>", "Status" },
u = { "<cmd>PackerUpdate<cr>", "Update" },
},
o = {
name = "Options",
c = { "<cmd>lua vim.g.cmp_active=false<cr>", "Completion off" },
C = { "<cmd>lua vim.g.cmp_active=true<cr>", "Completion on" },
w = { '<cmd>lua require("user.functions").toggle_option("wrap")<cr>', "Wrap" },
r = { '<cmd>lua require("user.functions").toggle_option("relativenumber")<cr>', "Relative" },
l = { '<cmd>lua require("user.functions").toggle_option("cursorline")<cr>', "Cursorline" },
s = { '<cmd>lua require("user.functions").toggle_option("spell")<cr>', "Spell" },
t = { '<cmd>lua require("user.functions").toggle_tabline()<cr>', "Tabline" },
},
-- s = {
-- name = "Split",
-- s = { "<cmd>split<cr>", "HSplit" },
-- v = { "<cmd>vsplit<cr>", "VSplit" },
-- },
S = {
name = "Session",
s = { "<cmd>SaveSession<cr>", "Save" },
r = { "<cmd>RestoreSession<cr>", "Restore" },
x = { "<cmd>DeleteSession<cr>", "Delete" },
f = { "<cmd>Autosession search<cr>", "Find" },
d = { "<cmd>Autosession delete<cr>", "Find Delete" },
-- a = { ":SaveSession<cr>", "test" },
-- a = { ":RestoreSession<cr>", "test" },
-- a = { ":RestoreSessionFromFile<cr>", "test" },
-- a = { ":DeleteSession<cr>", "test" },
},
r = {
name = "Replace",
r = { "<cmd>lua require('spectre').open()<cr>", "Replace" },
w = { "<cmd>lua require('spectre').open_visual({select_word=true})<cr>", "Replace Word (Workspace)" },
f = { "<cmd>lua require('spectre').open_file_search({select_word=true})<cr>", "Replace Word (Buffer)" },
b = { "<cmd>lua require('spectre').open_file_search()<cr>", "Replace Buffer" },
},
R = {
name = "Code Runner",
b = { ":TermExec cmd=./.buildme.sh<CR>", "Build the project" },
p = { ':TermExec cmd="python %<CR>"', "Run python file" },
},
D = {
name = "Debug",
b = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Breakpoint" },
c = { "<cmd>lua require'dap'.continue()<cr>", "Continue" },
i = { "<cmd>lua require'dap'.step_into()<cr>", "Into" },
o = { "<cmd>lua require'dap'.step_over()<cr>", "Over" },
O = { "<cmd>lua require'dap'.step_out()<cr>", "Out" },
r = { "<cmd>lua require'dap'.repl.toggle()<cr>", "Repl" },
l = { "<cmd>lua require'dap'.run_last()<cr>", "Last" },
u = { "<cmd>lua require'dapui'.toggle()<cr>", "UI" },
x = { "<cmd>lua require'dap'.terminate()<cr>", "Exit" },
},
d = {
name = "Diagnostics",
c = {
"<cmd>lua require('telescope.builtin').diagnostics({ bufnr = 0 })<cr>",
"Diagnostics of current buffer",
},
w = {
"<cmd>lua require('telescope.builtin').diagnostics()<cr>",
"Workspace Diagnostics",
},
u = {
"<cmd>lua require('telescope.builtin').diagnostics({ no_unlisted = true })<cr>",
"Diagnostics from listed buffers",
},
},
-- nnoremap <silent> <leader>B :lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>
-- nnoremap <silent> <leader>lp :lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>
-- require("dapui").open()
-- require("dapui").close()
-- require("dapui").toggle()
f = {
name = "Find using Telescope",
B = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
b = { "<cmd>Telescope buffers<cr>", "Buffers" },
c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
-- f = {"<cmd>lua require('telescope.builtin').find_files(require('user.telescope.user_themes').get_ivy_vertical{})<cr>", "Find files"},
f = { "<cmd>Telescope find_files<cr>", "Find files" },
g = { "<cmd>Telescope git_files<cr>", "Git Files" },
-- t = {"<cmd>lua require('telescope.builtin').live_grep(require('user.telescope.user_themes').get_ivy_vertical{})<cr>", "Find files"},
-- T = { "<cmd>lua require('telescope').extensions.live_grep_args.live_grep_args()<cr>", "Find text (live grep args)" },
T = { "<cmd>Telescope live_grep_args<cr>", "Find text (live grep args)" },
t = { "<cmd>Telescope live_grep<cr>", "Find Text" },
s = { "<cmd>Telescope grep_string<cr>", "Find String" },
h = { "<cmd>Telescope help_tags<cr>", "Help" },
H = { "<cmd>Telescope highlights<cr>", "Highlights" },
-- i = { "<cmd>lua require('telescope').extensions.media_files.media_files()<cr>", "Media" },
i = { "<cmd>Telescope lsp_incoming_calls<cr>", "Incoming calls" },
o = { "<cmd>Telescope lsp_outgoing_calls<cr>", "Outgoing calls" },
I = { "<cmd>Telescope lsp_implementations<cr>", "Implementations" },
l = { "<cmd>Telescope resume<cr>", "Last Search" },
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
r = { "<cmd>Telescope oldfiles<cr>", "Recent File" },
R = { "<cmd>Telescope registers<cr>", "Registers" },
k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
C = { "<cmd>Telescope commands<cr>", "Commands" },
},
g = {
name = "Git",
-- TODO: Not really a good idea to use lazygit within neovim: https://github.com/jesseduffield/lazygit/issues/996
g = { "<cmd>lua require ('user.terminal').lazygit_toggle()<cr>", "Lazygit" },
j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
l = { "<cmd>GitBlameToggle<cr>", "Blame" },
p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
u = {
"<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
"Undo Stage Hunk",
},
o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
d = {
"<cmd>Gitsigns diffthis HEAD<cr>",
"Diff",
},
G = {
name = "Gist",
a = { "<cmd>Gist -b -a<cr>", "Create Anon" },
d = { "<cmd>Gist -d<cr>", "Delete" },
f = { "<cmd>Gist -f<cr>", "Fork" },
g = { "<cmd>Gist -b<cr>", "Create" },
l = { "<cmd>Gist -l<cr>", "List" },
p = { "<cmd>Gist -b -p<cr>", "Create Private" },
},
},
-- GitBlame
G = {
l = { "<cmd>GitBlameToggle<cr>", "Blame Toggle" },
c = { "<cmd>GitBlameCopySHA<cr>", "Copy SHA URL of the commit" },
o = { "<cmd>GitBlameOpenCommitURL<cr>", "Open commit URL" },
},
l = {
name = "LSP",
A = { "<cmd>lua vim.lsp.codelens.run()<cr>", "CodeLens Action" },
a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
c = { "<cmd>lua require('user.lsp').server_capabilities()<cr>", "Get Capabilities" },
-- d = { "<cmd>TroubleToggle<cr>", "Diagnostics" },
d = {
"<cmd>lua require('telescope.builtin').diagnostics({ bufnr = 0 })<cr>",
"Document diagnostics",
},
w = {
"<cmd>lua require('telescope.builtin').diagnostics()<cr>",
"Workspace Diagnostics",
},
f = { "<cmd>lua vim.lsp.buf.format({ async = true })<cr>", "Format" },
F = { "<cmd>LspToggleAutoFormat<cr>", "Toggle Autoformat" },
i = { "<cmd>MasonLog<cr>", "Info" },
h = { "<cmd>lua require('lsp-inlayhints').toggle()<cr>", "Toggle Hints" },
H = { "<cmd>IlluminateToggle<cr>", "Toggle Doc HL" },
I = { "<cmd>Mason<cr>", "Installer Info" },
j = {
"<cmd>lua vim.diagnostic.goto_next({buffer=0})<CR>",
"Next Diagnostic",
},
k = {
"<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>",
"Prev Diagnostic",
},
v = { "<cmd>lua require('lsp_lines').toggle()<cr>", "Virtual Lines" },
V = {
function()
vim.diagnostic.config { virtual_text = not vim.diagnostic.config().virtual_text }
end,
"Virtual Text",
},
o = { "<cmd>SymbolsOutline<cr>", "Outline" },
q = { "<cmd>lua vim.diagnostic.setloclist()<cr>", "Quickfix (Diagnostics)" },
Q = { "<cmd>lua require('telescope.builtin').quickfix()<cr>", "Quickfix (Telescope)" },
r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
R = { "<cmd>TroubleToggle lsp_references<cr>", "References" },
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
S = {
"<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
"Workspace Symbols",
},
g = {
name = "Goto Preview",
g = {
"<cmd>lua require('goto-preview').goto_preview_definition()<cr>",
"Definition",
},
t = {
"<cmd>lua require('goto-preview').goto_preview_type_definition()<cr>",
"Type Definition",
},
i = {
"<cmd>lua require('goto-preview').goto_preview_implementation()<cr>",
"Implementation",
},
-- Requires telescope
r = {
"<cmd>lua require('goto-preview').goto_preview_references()<cr>",
"References",
},
c = {
"<cmd>lua require('goto-preview').close_all_win()<cr>",
"Close all windows",
},
},
t = { '<cmd>lua require("user.functions").toggle_diagnostics()<cr>', "Toggle Diagnostics" },
u = { "<cmd>LuaSnipUnlinkCurrent<cr>", "Unlink Snippet" },
},
n = {
-- name = "Session",
-- s = { "<cmd>SaveSession<cr>", "Save" },
-- l = { "<cmd>LoadLastSession!<cr>", "Load Last" },
-- d = { "<cmd>LoadCurrentDirSession!<cr>", "Load Last Dir" },
-- f = { "<cmd>Telescope sessions save_current=false<cr>", "Find Session" },
name = "SnipRun",
c = { "<cmd>SnipClose<cr>", "Close" },
f = { "<cmd>%SnipRun<cr>", "Run File" },
i = { "<cmd>SnipInfo<cr>", "Info" },
m = { "<cmd>SnipReplMemoryClean<cr>", "Mem Clean" },
r = { "<cmd>SnipReset<cr>", "Reset" },
t = { "<cmd>SnipRunToggle<cr>", "Toggle" },
x = { "<cmd>SnipTerminate<cr>", "Terminate" },
},
t = {
name = "Terminal",
["1"] = { ":1ToggleTerm<cr>", "1" },
["2"] = { ":2ToggleTerm<cr>", "2" },
["3"] = { ":3ToggleTerm<cr>", "3" },
["4"] = { ":4ToggleTerm<cr>", "4" },
n = { "<cmd>lua _NODE_TOGGLE()<cr>", "Node" },
u = { "<cmd>lua _NCDU_TOGGLE()<cr>", "NCDU" },
t = { "<cmd>lua _HTOP_TOGGLE()<cr>", "Htop" },
m = { "<cmd>lua _MAKE_TOGGLE()<cr>", "Make" },
f = { "<cmd>ToggleTerm direction=float<cr>", "Float" },
h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" },
v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" },
},
T = {
name = "Telescope",
c = { "<cmd>Telescope commands<cr>", "Commands" },
p = { "<cmd>Telescope projects<cr>", "Projects" },
d = { "<cmd>Telescope diagnostics<cr>", "Diagnostics" },
m = { "<cmd>Telescope media_files<cr>", "Media Files" },
g = {
name = "Git",
c = { "<cmd>Telescope git_commits<cr>", "Git Commits" },
b = { "<cmd>Telescope git_branches<cr>", "Git Branches" },
s = { "<cmd>Telescope git_status<cr>", "Git Status" },
S = { "<cmd>Telescope git_stash<cr>", "Git Stash" },
},
f = {
"<cmd>Telescope find_files<cr>",
"Find Files",
},
C = { "<cmd>Telescope command_history<cr>", "Command History" },
j = { "<cmd>Telescope jumplist<cr>", "Jumplist" },
r = { "<cmd>Telescope resume<cr>", "Resume" },
s = { "<cmd>Telescope symbols<cr>", "Symbols" },
h = { "<cmd>Telescope search_history<cr>", "Search History" },
-- h = { "<cmd>TSHighlightCapturesUnderCursor<cr>", "Highlight" },
-- p = { "<cmd>TSPlaygroundToggle<cr>", "Playground" },
-- r = { "<cmd>TSToggle rainbow<cr>", "Rainbow" },
},
-- z = {
-- name = "Zen",
-- z = { "<cmd>TZAtaraxis<cr>", "Zen" },
-- m = { "<cmd>TZMinimalist<cr>", "Minimal" },
-- n = { "<cmd>TZNarrow<cr>", "Narrow" },
-- f = { "<cmd>TZFocus<cr>", "Focus" },
-- },
x = {
name = "Transparent",
t = { "<cmd>TransparentToggle<cr>", "Toggle transparency" },
},
}
local vopts = {
mode = "v", -- VISUAL mode
prefix = "<leader>",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps
nowait = true, -- use `nowait` when creating keymaps
}
local vmappings = {
["/"] = { '<ESC><CMD>lua require("Comment.api").toggle.linewise(vim.fn.visualmode())<CR>', "Comment" },
s = { "<esc><cmd>'<,'>SnipRun<cr>", "Run range" },
-- z = { "<cmd>TZNarrow<cr>", "Narrow" },
}
which_key.setup(setup)
which_key.register(mappings, opts)
which_key.register(vmappings, vopts)
which_key.register(m_mappings, m_opts)