-
-
Notifications
You must be signed in to change notification settings - Fork 63
Migrating From Another Plugin
kylechui edited this page Aug 12, 2022
·
3 revisions
TODO: Add table comparing features
- Dot-repeat
- Smart quotes
- Reverse jumping
The default configuration matches many things in vim-surround
; most features
in nvim-surround
are designed to be an extension of those found in
vim-surround
, as opposed to completely different behavior. Here's a
configuration that gets reasonably close:
require("nvim-surround").setup({
aliases = {
["<"] = "t",
},
})
A few quirks to take note of:
- In general, extraneous whitespace is ignored for all normal mode surrounds.
- The command
ysa"b
for the bufferlocal str = "test string"
would yieldlocal str = ("test string")
. - The command
ysibB
for the buffer( some text )
would yield( {some text} )
.
- The command
- HTML-related:
- When filling out the contents of an HTML tag,
<
and>
are optional. -
>
does not end the user-input,<CR>
does. - When changing the surrounding tag, the "HTML key" only needs to be pressed
once, e.g.
cst
instead ofcstt
. - By default,
cst
will change just the tag type, whilecsT
will change the whole tag contents.
- When filling out the contents of an HTML tag,
TODO: Include more detailed information about vim-sandwich
require("nvim-surround").setup({
keymaps = {
normal = "sa",
delete = "sd",
change = "sr",
},
})
TODO: Add mini.surround configuration, differences