119 lines
4.3 KiB
Lua
119 lines
4.3 KiB
Lua
return {
|
|
{
|
|
"folke/which-key.nvim",
|
|
event = "VeryLazy",
|
|
opts = {
|
|
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?
|
|
},
|
|
},
|
|
key_labels = {
|
|
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
|
["<leader>"] = "SPC",
|
|
},
|
|
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
|
|
-- },
|
|
},
|
|
config = function(_, opts)
|
|
local whichkey = require("which-key")
|
|
whichkey.setup(opts)
|
|
|
|
local leader_opts = {
|
|
mode = { "n", "v" }, -- NORMAL/VISUAL mode
|
|
buffer = nil, -- Global mappings
|
|
prefix = "<leader>",
|
|
silent = true, -- use 'silent'
|
|
noremap = true, -- use 'noremap'
|
|
nowait = true, -- use 'nowait'
|
|
}
|
|
|
|
whichkey.register({
|
|
mode = { "n", "v" },
|
|
["g"] = { name = "+goto" },
|
|
["m"] = { name = "+harpoon" },
|
|
["]"] = { name = "+next" },
|
|
["["] = { name = "+previous" },
|
|
})
|
|
|
|
local leader_mappings = {
|
|
l = { name = "+lsp" },
|
|
b = { name = "+buffer" },
|
|
r = { name = "+replace" },
|
|
f = { name = "+file" },
|
|
s = { name = "+search" },
|
|
h = { name = "+help" },
|
|
g = { name = "+git" },
|
|
t = { name = "+todo" },
|
|
N = { name = "+noice" },
|
|
o = { name = "+option" },
|
|
|
|
H = { "<cmd>split<cr>", "Split" },
|
|
V = { "<cmd>vsplit<cr>", "V Split" },
|
|
n = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
|
|
P = { "<cmd>!opout %<cr><cr>", "Preview Document" },
|
|
q = { '<cmd>lua require("lazyvim.functions").smart_quit()<CR>', "Quit" },
|
|
w = { "<cmd>w<CR>", "Write" },
|
|
z = { "<cmd>ZenMode<cr>", "Zen" },
|
|
["'"] = { "<cmd>close<CR>", "Close split" },
|
|
u = { "<cmd>UndotreeToggle<cr>", "Undo Tree" },
|
|
|
|
C = {
|
|
name = "Compiler",
|
|
c = { "<cmd>w! | !compiler %<cr>", "Compile File" },
|
|
b = { "<cmd>w! | !pandoc % -t beamer -o presentation.pdf<cr>", "Beamer Presentation" },
|
|
},
|
|
|
|
-- 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" },
|
|
-- },
|
|
|
|
-- 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" },
|
|
-- },
|
|
}
|
|
|
|
whichkey.register(leader_mappings, leader_opts)
|
|
end,
|
|
},
|
|
}
|