4 changed files with 35 additions and 37 deletions
@ -1,33 +0,0 @@ |
|||||
-- surround |
|
||||
return { |
|
||||
"echasnovski/mini.surround", |
|
||||
keys = function(_, keys) |
|
||||
-- Populate the keys based on the user's options |
|
||||
local plugin = require("lazy.core.config").spec.plugins["mini.surround"] |
|
||||
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`" }, |
|
||||
} |
|
||||
mappings = vim.tbl_filter(function(m) |
|
||||
return m[1] and #m[1] > 0 |
|
||||
end, mappings) |
|
||||
return vim.list_extend(mappings, keys) |
|
||||
end, |
|
||||
opts = { |
|
||||
mappings = { |
|
||||
add = "gza", -- Add surrounding in Normal and Visual modes |
|
||||
delete = "gzd", -- Delete surrounding |
|
||||
find = "gzf", -- Find surrounding (to the right) |
|
||||
find_left = "gzF", -- Find surrounding (to the left) |
|
||||
highlight = "gzh", -- Highlight surrounding |
|
||||
replace = "gzr", -- Replace surrounding |
|
||||
update_n_lines = "gzn", -- Update `n_lines` |
|
||||
}, |
|
||||
}, |
|
||||
} |
|
||||
@ -0,0 +1,13 @@ |
|||||
|
-- surround |
||||
|
return { |
||||
|
"kylechui/nvim-surround", |
||||
|
version = "*", -- Use for stability; omit to use `main` branch for the latest features |
||||
|
event = "VeryLazy", |
||||
|
config = function() |
||||
|
require("nvim-surround").setup({ |
||||
|
keymaps = { |
||||
|
visual = "Y", |
||||
|
}, |
||||
|
}) |
||||
|
end |
||||
|
} |
||||
Loading…
Reference in new issue