gepoch / vim-surround

Surround for the Atom editor.
MIT License
52 stars 2 forks source link

Support invoking from normal mode, e.g. `ys<text object><character>` #31

Open wmayner opened 9 years ago

wmayner commented 9 years ago

Thanks for bringing the incredible vim-surround to Atom!

The original supports surrounding a text object with the normal-mode command ys. From the README:

Now with the cursor on "Hello", press ysiw] (iw is a text object).

[Hello] world! This is how I usually use the plugin in Vim, rather than selecting with visual mode and then surrounding.

It would be awesome to be able to use it that way in Atom too. Of course, that would mean interacting with vim-mode's API to get a handle on an arbitrary text object; I don't know how easy that is given how it's currently implemented and how their API works.

gepoch commented 9 years ago

Yep, this is a huge issue facing vim-surround. It's pretty much an extended hack right now.

I have plans to get it rewritten as a proper member of the vim-mode universe, but I've been swamped at the day job! It's definitely in the road map.

PRs welcome ;)

dragonxlwang commented 8 years ago

+1 hope ysiw" would work!