nvim/lua/plugins/surround.lua

29 lines
917 B
Lua

-- Phase 6.4: nvim-surround for surrounding text with quotes, brackets, tags, etc.
return {
'kylechui/nvim-surround',
version = '*', -- Use stable releases
event = 'VeryLazy',
opts = {
-- Default keymaps:
-- ys{motion}{char} - Add surround in normal mode (e.g., ysiw" to surround word with quotes)
-- ds{char} - Delete surround (e.g., ds" to delete surrounding quotes)
-- cs{old}{new} - Change surround (e.g., cs"' to change " to ')
-- S{char} - Add surround in visual mode (e.g., select text, S" to wrap in quotes)
-- Keep default keymaps; minimal config
keymaps = {
insert = '<C-g>s',
insert_line = '<C-g>S',
normal = 'ys',
normal_cur = 'yss',
normal_line = 'yS',
normal_cur_line = 'ySS',
visual = 'S',
visual_line = 'gS',
delete = 'ds',
change = 'cs',
change_line = 'cS',
},
},
}