vim-surround icon indicating copy to clipboard operation
vim-surround copied to clipboard

Added an option 'o' for setting custom surround

Open NonLogicalDev opened this issue 11 years ago • 3 comments

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
` ` `

NonLogicalDev avatar Jun 01 '13 02:06 NonLogicalDev

I love this commit, that I find extremely useful to bold the text in Markdown, by selecting text then type:

ysiwo **\r**

0xgrm avatar Jan 27 '14 21:01 0xgrm

I like the idea, typing \r feels awkward, and I'm not sure what o is a mnemonic for.

tpope avatar Apr 07 '14 06:04 tpope

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 ..."

wellle avatar Feb 01 '15 00:02 wellle