Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an option 'o' for setting custom surround #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NonLogicalDev
Copy link

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

It is sometimes nice to be able to just type in the expression rather
then prepare it ahead of the time.
@0xgrm
Copy link

0xgrm commented Jan 27, 2014

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

ysiwo **\r**

@tpope
Copy link
Owner

tpope commented Apr 7, 2014

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

@wellle
Copy link

wellle commented Feb 1, 2015

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

somini added a commit to somini/vim-surround that referenced this pull request Sep 10, 2017
somini added a commit to somini/vim-surround that referenced this pull request Sep 10, 2017
Apply tpope#97 to the auloadized version.
somini added a commit to somini/vim-surround that referenced this pull request Jun 2, 2018
Apply tpope#97 to the auloadized version.
somini added a commit to somini/vim-surround that referenced this pull request Jun 2, 2018
somini added a commit to somini/vim-surround that referenced this pull request Jun 2, 2018
Apply tpope#97 to the autoloadized version.
somini added a commit to somini/vim-surround that referenced this pull request Jun 2, 2018
Apply tpope#97 to the autoloadized version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants