-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: which-key v3 integration and refactoring
- Loading branch information
Showing
13 changed files
with
69 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
local wk = require("which-key") | ||
wk.register({ | ||
c = { | ||
name = "Coding", | ||
r = { | ||
function() | ||
require("luapad.run").run() | ||
end, | ||
"Run buffer content", | ||
}, | ||
l = { | ||
function() | ||
require("luapad").init() | ||
end, | ||
"Luapad", | ||
}, | ||
t = { "<cmd>lua MiniTest.run_file()<cr>", "MiniTest for current file" }, | ||
s = { "<cmd>lua MiniTest.run()<cr>", "Run MiniTest suite" }, | ||
wk.add({ | ||
{ "<leader>c", "", desc = "+Coding" }, | ||
{ | ||
"<leader>cr", | ||
function() | ||
require("luapad.run").run() | ||
end, | ||
desc = "Run buffer content", | ||
}, | ||
}, { prefix = "<leader>", mode = "n" }) | ||
{ | ||
"<leader>cl", | ||
function() | ||
require("luapad").init() | ||
end, | ||
desc = "Luapad", | ||
}, | ||
{ "<leader>ct", "<cmd>lua MiniTest.run_file()<cr>", desc = "MiniTest for current file" }, | ||
{ "<leader>cs", "<cmd>lua MiniTest.run()<cr>", desc = "Run MiniTest suite" }, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
local user_config = vim.g.config.plugins.which_key or {} | ||
local icons = require("utils.icons") | ||
local M = { | ||
"folke/which-key.nvim", | ||
event = "VeryLazy", | ||
|
||
local default_config = { | ||
opts = { | ||
preset = "modern", | ||
icons = { | ||
rules = false, -- disable icons in keymaps | ||
breadcrumb = icons.arrows.DoubleArrowRight, -- symbol used in the command line area that shows your active key combo | ||
separator = icons.arrows.SmallArrowRight, -- symbol used between a key and it's label | ||
group = icons.ui.Plus, -- symbol prepended to a group | ||
}, | ||
window = { | ||
border = "none", -- none, single, double, shadow | ||
position = "bottom", -- bottom, top | ||
margin = { 0, 10, 3, 10 }, -- extra window margin [top, right, bottom, left] | ||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] | ||
}, | ||
layout = { | ||
height = { min = 3, max = 25 }, -- min and max height of the columns | ||
width = { min = 5, max = 50 }, -- min and max width of the columns | ||
spacing = 10, -- spacing between columns | ||
align = "center", -- align columns left, center or right | ||
}, | ||
groups = { | ||
mode = { "n", "v" }, | ||
["<leader>b"] = { name = "Buffers" }, | ||
["<leader>f"] = { name = "Files" }, | ||
["<leader>l"] = { name = "LSP" }, | ||
["<leader>m"] = { name = "Misc" }, | ||
["<leader>q"] = { name = "Quickfix" }, | ||
["<leader>R"] = { name = "Replace" }, | ||
["<leader>mS"] = { name = "TreeSJ" }, | ||
["<leader>s"] = { name = "Search" }, | ||
["<leader>t"] = { name = "Toggles" }, | ||
["<leader>w"] = { name = "Window" }, | ||
["<leader>z"] = { name = "Spelling" }, | ||
spec = { | ||
{ "<leader>b", group = "Buffers" }, | ||
{ "<leader>f", group = "Files" }, | ||
{ "<leader>l", group = "LSP" }, | ||
{ "<leader>m", group = "Misc" }, | ||
{ "<leader>q", group = "Quickfix" }, | ||
{ "<leader>R", group = "Replace" }, | ||
{ "<leader>mS", group = "TreeSJ" }, | ||
{ "<leader>s", group = "Search" }, | ||
{ "<leader>t", group = "Toggles" }, | ||
{ "<leader>w", group = "Window" }, | ||
{ "<leader>z", group = "Spelling" }, | ||
}, | ||
}, | ||
} | ||
|
||
local config = vim.tbl_deep_extend("force", default_config, user_config) | ||
|
||
return { | ||
"folke/which-key.nvim", | ||
event = "VeryLazy", | ||
opts_extend = { "spec" }, | ||
opts = config.opts, | ||
config = function(_, opts) | ||
local wk = require("which-key") | ||
wk.setup(opts) | ||
wk.register(opts.groups) | ||
end, | ||
} | ||
|
||
return M |