Wednesday, September 28, 2011

Re: Is there a way to mimic textmate's "wrap each selected line in open/close tag" ?

To surround the current line with say a div-tag, type the following while your cursor is on the line:
Vstdiv
 
I would like to do this to each line in a visual block (TextMate - Shift-Ctrl-Cmd W). Tim Chase suggested using ex mode substitute which works. I will probably end up creating a map. But before I do that, I would like to find out if there is a more "surround.vim"-ish way :-)


Also, I am viws" does not wrap the word with " - instead it deletes the word and puts you between "".  viwS" seems to do the right thing. Is this correct behaviour?

It is. Use ysiw" instead.
But viws" doesn't - here's my wrong-headed way of thinking viw selects inner word to which i want to apply surround using ". Just want to make sure I understand this.

Thanks for the replies.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment