vis-surround
aims to port Tim Pope's vim-surround to Vis. It is not quite as powerful yet, see the TODO list below.
Clone the repo to your vis plugins directory (~/.config/vis/plugins
) and add
this to your visrc.lua
:
require("plugins/vis-surround")
Use the cs
("change surrounding") prefix and two surrounding characters to change surroundings, use ds
("delete surrounding") and a surrounding character to delete a surrounding.
Examples:
Pressing cs"'
inside
"Hello world!"
will give you:
'Hello world!'
Pressing cs{]
(if you use opening or closing brackets doesn't matter) inside
{Hello world!}
will give you:
[Hello world!]
To delete the [
, ]
characters press ds[
. This is the result:
Hello world!
- XML tags
- XML/HTML tags with attributes (i.e.
<p class="foo">
) - Adding tags with text objects