fix: surround update

This commit is contained in:
Mathias Schneider
2026-04-13 11:42:44 +02:00
parent 1c47a8aaf9
commit 2e3970f1ef
+26 -6
View File
@@ -2,14 +2,34 @@ return {
"kylechui/nvim-surround", "kylechui/nvim-surround",
version = "*", version = "*",
event = "VeryLazy", event = "VeryLazy",
init = function()
-- Disable default keymaps (we'll set custom ones)
vim.g.nvim_surround_no_mappings = true
end,
config = function() config = function()
require("nvim-surround").setup({ require("nvim-surround").setup({
keymaps = { -- Configuration for surrounds, aliases, etc. can go here
add = "S", -- Add surrounding })
delete = "SD", -- Delete surrounding -- Set custom keymaps (v4 method)
change = "SC", -- Change surrounding -- Add surrounding: Siw" -> surround word with quotes, Siw) -> (surround word)
change_line = "SCL", -- Change surrounding on current line vim.keymap.set("n", "S", "<Plug>(nvim-surround-normal)", {
}, desc = "Add surrounding",
})
-- Delete surrounding: SD" -> remove quotes, SD) -> remove parentheses
vim.keymap.set("n", "SD", "<Plug>(nvim-surround-delete)", {
desc = "Delete surrounding",
})
-- Change surrounding: SC"' -> change quotes to single quotes, SC)] -> change parens to brackets
vim.keymap.set("n", "SC", "<Plug>(nvim-surround-change)", {
desc = "Change surrounding",
})
-- Change surrounding on current line
vim.keymap.set("n", "SCL", "<Plug>(nvim-surround-change-line)", {
desc = "Change surrounding on current line",
})
-- Visual mode: select text and press S" -> surround selection with quotes
vim.keymap.set("v", "S", "<Plug>(nvim-surround-visual)", {
desc = "Add surrounding in visual mode",
}) })
end, end,
} }