2023-04-09 19:31:14 +02:00
|
|
|
-- buffer
|
2023-03-26 18:28:49 +02:00
|
|
|
require("which-key").register({
|
|
|
|
b = {
|
2023-04-09 19:31:14 +02:00
|
|
|
name = "buffer",
|
2023-03-26 18:28:49 +02:00
|
|
|
b = { "<cmd>Telescope buffers<cr>", "List buffers" },
|
|
|
|
d = { "<cmd>bd<cr>", "Delete buffer" },
|
|
|
|
},
|
2023-05-02 09:06:54 +02:00
|
|
|
}, { prefix = "<leader>" })
|
|
|
|
require("which-key").register({
|
|
|
|
["["] = {
|
|
|
|
b = { "<cmd>bprevious<cr>", "Previous buffer" },
|
|
|
|
},
|
|
|
|
["]"] = {
|
|
|
|
b = { "<cmd>bnext<cr>", "Next buffer" },
|
|
|
|
},
|
2023-03-26 18:28:49 +02:00
|
|
|
})
|
|
|
|
|
2023-04-09 19:31:14 +02:00
|
|
|
-- window
|
|
|
|
require("which-key").register({
|
|
|
|
w = {
|
|
|
|
name = "window",
|
|
|
|
["|"] = { "<C-w>v", "Split window horizontally" },
|
|
|
|
["-"] = { "<C-w>s", "Split window vertically" },
|
|
|
|
w = { "<C-w>w", "Switch window" },
|
|
|
|
d = { "<C-w>c", "Delete window" },
|
|
|
|
},
|
|
|
|
}, { prefix = "<leader>" })
|
|
|
|
|
|
|
|
-- fast window move
|
|
|
|
require("which-key").register({
|
|
|
|
["<C-h>"] = { "<C-w>h", "Move window left" },
|
|
|
|
["<C-j>"] = { "<C-w>j", "Move window down" },
|
|
|
|
["<C-k>"] = { "<C-w>k", "Move window up" },
|
|
|
|
["<C-l>"] = { "<C-w>l", "Move window right" },
|
|
|
|
})
|
|
|
|
|
|
|
|
-- tab
|
|
|
|
require("which-key").register({
|
|
|
|
["<tab>"] = {
|
|
|
|
name = "tab",
|
|
|
|
["<tab>"] = { "<cmd>tabnew<cr>", "New tab" },
|
|
|
|
n = { "<cmd>tabnext<cr>", "Next tab" },
|
|
|
|
p = { "<cmd>tabprevious<cr>", "Previous tab" },
|
|
|
|
d = { "<cmd>tabclose<cr>", "Close tab" },
|
|
|
|
},
|
|
|
|
}, { prefix = "<leader>" })
|
|
|
|
|
|
|
|
-- file
|
|
|
|
require("which-key").register({
|
|
|
|
f = {
|
|
|
|
name = "file/find",
|
|
|
|
n = { "<cmd>enew<cr>", "New file" },
|
|
|
|
},
|
|
|
|
}, { prefix = "<leader>" })
|
|
|
|
|
|
|
|
-- better descriptions for navigation
|
|
|
|
require("which-key").register({
|
2023-04-10 15:14:04 +02:00
|
|
|
["<leader>"] = {
|
|
|
|
f = { name = "file/find" },
|
|
|
|
g = { name = "git" },
|
|
|
|
l = { name = "lsp" },
|
|
|
|
o = { name = "org" },
|
|
|
|
s = { name = "search" },
|
|
|
|
t = { name = "toggle" },
|
|
|
|
x = { name = "diagnostics/quickfix" },
|
|
|
|
},
|
2023-04-09 19:31:14 +02:00
|
|
|
["["] = { name = "prev" },
|
|
|
|
["]"] = { name = "next" },
|
2023-04-10 15:14:04 +02:00
|
|
|
g = { name = "goto" },
|
2023-04-09 19:31:14 +02:00
|
|
|
})
|
|
|
|
|
2023-03-26 18:28:49 +02:00
|
|
|
-- Clear search with <esc>
|
|
|
|
require("which-key").register({
|
|
|
|
["<esc>"] = { "<cmd>noh<cr><esc>", "Escape and clear hlsearch", mode = { "n", "i" } },
|
|
|
|
})
|
|
|
|
|
|
|
|
-- better indenting
|
|
|
|
require("which-key").register({
|
|
|
|
["<"] = { "<gv", "Shift left" },
|
|
|
|
[">"] = { ">gv", "Shift right" },
|
|
|
|
}, { mode = "v" })
|