t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 112 forks source link

vim-surround with tag elements [feature request] #381

Open marcosfede opened 8 years ago

marcosfede commented 8 years ago

Hi, thank you for vim-mode-plus it's awesome. There is one feature I miss from surround/idea-vim and I wonder if it would be possible to have with vim-mode-plus. Currently when you use the surround commands its not possible to surround with a html tag element. normally pressing "t" after a surround command would prompt me for the name of the html tag, but instead it surrounds with the literal letter t. Would it be possible to add this functionality? Thanks!

t9md commented 8 years ago

Not sure, I myself have no time to enhance this aspect.

If someone try to implement this feature, pls try as vim-mode-plus-plugin if it's works.

purplecones commented 7 years ago

I agree, this would be a helpful feature.

purplecones commented 7 years ago

FYI. @marcosfede I came across this plugin that does this: https://github.com/dsandstrom/atom-double-tag

JasonTheAdams commented 7 years ago

Definitely miss this feature from surround/idea-vim. I don't want to have it select on both sides like the atom-double-tag plugin, but think of the tags as just another method of surrounding. Like @marcosfede said, right now the character is displayed next to the cursor that the surrounding area is being modified to, it would be great to have it linger for tags to allow the user to type in the tag (i.e. div) and then apply when the user hits enter.

ajs139 commented 7 years ago

Could it invoke https://atom.io/packages/atom-wrap-in-tag?

hagabaka commented 7 years ago

vim-surround seems to allow you to just type in the open tag. I assume it handles the surrounding input specially if you type in <, and allows more characters until you type >.

Emphasize hello: ysiw<em>

<em>Hello</em> world!

Finally, let's try out visual mode. Press a capital V (for linewise visual mode) followed by S<p class="important">.

<p class="important">
  <em>Hello</em> world!
 </p>