fix(which-key): migrate to some new format, somewhat
This commit is contained in:
parent
5716a3de5a
commit
7467428750
1 changed files with 31 additions and 23 deletions
|
|
@ -1,39 +1,47 @@
|
||||||
return {
|
return {
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
--event = { "BufReadPre", "BufNewFile" },
|
--event = { "BufReadPre", "BufNewFile" },
|
||||||
--event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
init = function()
|
init = function()
|
||||||
vim.o.timeout = true
|
vim.o.timeout = true
|
||||||
vim.o.timeoutlen = 250
|
vim.o.timeoutlen = 250
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
layout = {
|
spec = {
|
||||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
{ "<leader>d", group = "diagnostics" },
|
||||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
{ "<leader>f", group = "find shite" },
|
||||||
spacing = 3, -- spacing between columns
|
{ "<leader>g", group = "git things" },
|
||||||
align = "left", -- align columns left, center or right
|
{ "<leader>gl", desc = "git logg" },
|
||||||
|
{ "<leader>q", desc = "trouble (this buffer)" },
|
||||||
},
|
},
|
||||||
window = {
|
notify = false, -- disable warnings for mappings
|
||||||
border = "none", -- none, single, double, shadow
|
win = {
|
||||||
position = "bottom", -- bottom, top
|
wo = {
|
||||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size.
|
winblend = 15,
|
||||||
padding = { 1, 2, 1, 2 }, -- extra window padding [top, right, bottom, left]
|
},
|
||||||
winblend = 1, -- value between 0-100 0 for fully opaque and 100 for fully transparent
|
|
||||||
zindex = 1000, -- positive value to position WhichKey above other floating windows.
|
|
||||||
},
|
|
||||||
defaults = {
|
|
||||||
mode = { "n", "v" },
|
|
||||||
["<leader>d"] = { name = "diagnostics" },
|
|
||||||
["<leader>f"] = { name = "find shit" },
|
|
||||||
["<leader>g"] = { name = "git" },
|
|
||||||
["<leader>gl"] = { name = "git log" },
|
|
||||||
["<leader>q"] = { name = "trouble this buffer" },
|
|
||||||
["<leader>Q"] = { name = "trouble all buffers" },
|
|
||||||
},
|
},
|
||||||
|
expand = 3, -- expand groups when <= n mappings
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
wk.setup(opts)
|
wk.setup(opts)
|
||||||
wk.register(opts.defaults)
|
--wk.register(opts.defaults)
|
||||||
|
wk.register(opts.spec)
|
||||||
|
|
||||||
|
--wk.add({
|
||||||
|
-- { "<leader>d", group = "diagnostics" },
|
||||||
|
-- { "<leader>f", group = "find shite" },
|
||||||
|
-- { "<leader>g", group = "git things" },
|
||||||
|
-- { "<leader>gl", desc = "git logg" },
|
||||||
|
-- { "<leader>q", desc = "trouble (this buffer)" },
|
||||||
|
-- --{ "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find File", mode = "n" },
|
||||||
|
-- {
|
||||||
|
-- "<leader>fb",
|
||||||
|
-- function()
|
||||||
|
-- print("hello")
|
||||||
|
-- end,
|
||||||
|
-- desc = "Foobar",
|
||||||
|
-- },
|
||||||
|
--})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue