Skip to content

Commit 9885e94

Browse files
committed
replace surround with nvim-surround
1 parent 19bf2c6 commit 9885e94

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

lua/plugin-config/nvim-surround.lua

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
local status, surround = pcall(require, "nvim-surround")
2+
if not status then
3+
vim.notify("没有找到 nvim-surround")
4+
return
5+
end
6+
7+
surround.setup({
8+
keymaps = {
9+
-- you surround
10+
normal = "ys",
11+
-- you surround with delimiter
12+
normal_line = "yS",
13+
-- you surround line
14+
normal_cur = "yss",
15+
-- you surround line with delimiter
16+
normal_cur_line = "ySS",
17+
18+
delete = "ds",
19+
change = "cs",
20+
21+
insert = "<C-g>s",
22+
insert_line = "<C-g>S",
23+
24+
visual = "s",
25+
visual_line = "gs",
26+
},
27+
})

lua/plugins.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,18 @@ packer.startup({
130130
})
131131

132132
-- surround
133+
-- use({
134+
-- "ur4ltz/surround.nvim",
135+
-- config = function()
136+
-- require("plugin-config.surround")
137+
-- end,
138+
-- })
139+
140+
-- nvim-surround
133141
use({
134-
"ur4ltz/surround.nvim",
142+
"kylechui/nvim-surround",
135143
config = function()
136-
require("plugin-config.surround")
144+
require("plugin-config.nvim-surround")
137145
end,
138146
})
139147

0 commit comments

Comments
 (0)