mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +02:00
feat(mini.surround): added lazy keys with descriptions to mini.surround
This commit is contained in:
parent
3d498ee713
commit
bf31eccae2
2 changed files with 15 additions and 2 deletions
|
@ -92,7 +92,20 @@ return {
|
|||
-- surround
|
||||
{
|
||||
"echasnovski/mini.surround",
|
||||
keys = { "gz" },
|
||||
keys = function(plugin, keys)
|
||||
-- Populate the keys based on the user's options
|
||||
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
|
||||
local mappings = {
|
||||
{ opts.mappings.add, desc = "Add surrounding", mode = { "n", "v" } },
|
||||
{ opts.mappings.delete, desc = "Delete surrounding" },
|
||||
{ opts.mappings.find, desc = "Find right surrounding" },
|
||||
{ opts.mappings.find_left, desc = "Find left surrounding" },
|
||||
{ opts.mappings.highlight, desc = "Highlight surrounding" },
|
||||
{ opts.mappings.replace, desc = "Replace surrounding" },
|
||||
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
|
||||
}
|
||||
return vim.list_extend(mappings, keys)
|
||||
end,
|
||||
opts = {
|
||||
mappings = {
|
||||
add = "gza", -- Add surrounding in Normal and Visual modes
|
||||
|
|
|
@ -138,7 +138,6 @@ return {
|
|||
event = "VeryLazy",
|
||||
opts = {
|
||||
plugins = { spelling = true },
|
||||
key_labels = { ["<leader>"] = "SPC" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local wk = require("which-key")
|
||||
|
@ -146,6 +145,7 @@ return {
|
|||
wk.register({
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["gz"] = { name = "+surround" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue