dotfiles/config/common/nvim/lua/plugins/common/which-key.lua

52 lines
1.1 KiB
Lua

local whichkey_spec = {
mode = { "n", "v" },
{ "<leader>b", group = "buffer" },
{ "<leader>f", group = "find" },
{ "<leader>h", group = "history" },
{ "<leader>u", group = "ui" },
}
if MainHost then
vim.list_extend(whichkey_spec, {
{ "<leader>c", group = "code" },
{ "<leader>cd", vim.diagnostic.open_float, { desc = "diagnostics", remap = true } },
{
"<leader>cf",
function()
require("conform").format({
lsp_fallback = true,
async = false,
})
end,
{ desc = "format", remap = true },
},
})
end
return {
"folke/which-key.nvim",
event = "VeryLazy",
config = function()
require("which-key").setup({
preset = "helix",
delay = 300,
icons = {
rules = false,
breadcrumb = "",
separator = "󱦰 ",
group = "󰹍 ",
},
plugins = {
spelling = {
enabled = false,
},
},
win = {
height = {
max = math.huge,
},
},
spec = whichkey_spec,
})
end,
}