vim-surround
vim-surround copied to clipboard
Added an option 'o' for setting custom surround
It is sometimes nice to be able to just type in the expression rather then prepare it ahead of the time.
Say if you want to refactor the code for which you do not have support. Or say you are editing github markdown and you want to encapsulate the code in ``` tags. With this you can simply do the following:
class test
def initialise
end
end
Select the text then:
gSo` ` `ruby\r` ` ` (I added spaces so that github does not covert them)
` ` ` ruby
class test
def initialise
end
end
` ` `
I love this commit, that I find extremely useful to bold the text in Markdown, by selecting text then type:
ysiwo **\r**
I like the idea, typing \r
feels awkward, and I'm not sure what o
is a mnemonic for.
I like this idea. Typing \r
could be avoided by calling input()
twice, once for before
and once for after
. I'm willing to take this over if there is a chance of it getting merged.
o
could be a mnemonic for "on the fly" (or "one time"). Personally I feel like it's kinda similar to :h i^o
. I'm also willing to change the character if there are alternatives. Couple of ideas:
-
u
could be "user defined" -
c
could be "custom" -
w
could read as "you surround inner word with ..."