diff --git a/lua/weeheavy/plugins/which-key.lua b/lua/weeheavy/plugins/which-key.lua index a513022..f361723 100644 --- a/lua/weeheavy/plugins/which-key.lua +++ b/lua/weeheavy/plugins/which-key.lua @@ -1,39 +1,47 @@ return { "folke/which-key.nvim", --event = { "BufReadPre", "BufNewFile" }, - --event = "VeryLazy", + event = "VeryLazy", init = function() vim.o.timeout = true vim.o.timeoutlen = 250 end, opts = { - 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 = "left", -- align columns left, center or right + spec = { + { "d", group = "diagnostics" }, + { "f", group = "find shite" }, + { "g", group = "git things" }, + { "gl", desc = "git logg" }, + { "q", desc = "trouble (this buffer)" }, }, - window = { - border = "none", -- none, single, double, shadow - position = "bottom", -- bottom, top - 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. - 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" }, - ["d"] = { name = "diagnostics" }, - ["f"] = { name = "find shit" }, - ["g"] = { name = "git" }, - ["gl"] = { name = "git log" }, - ["q"] = { name = "trouble this buffer" }, - ["Q"] = { name = "trouble all buffers" }, + notify = false, -- disable warnings for mappings + win = { + wo = { + winblend = 15, + }, }, + expand = 3, -- expand groups when <= n mappings }, config = function(_, opts) local wk = require("which-key") wk.setup(opts) - wk.register(opts.defaults) + --wk.register(opts.defaults) + wk.register(opts.spec) + + --wk.add({ + -- { "d", group = "diagnostics" }, + -- { "f", group = "find shite" }, + -- { "g", group = "git things" }, + -- { "gl", desc = "git logg" }, + -- { "q", desc = "trouble (this buffer)" }, + -- --{ "ff", "Telescope find_files", desc = "Find File", mode = "n" }, + -- { + -- "fb", + -- function() + -- print("hello") + -- end, + -- desc = "Foobar", + -- }, + --}) end, }