Wednesday, September 28, 2011

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

On Sep 28, 7:52 am, Amitava Shee <amitava.s...@gmail.com> wrote:
> I have starting using the excellent surround.vim plugin. Is there a way to
> mimic textmate's "wrap each selected line in open/close tag" ?
>

:'<,'>normal yss<tagname>

This will execute the (mapped) normal-mode command yss<tagname>, which
surround.vim will use to surround the entire line in a <tagname> tag
pair, on every line in the visual selection.

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

Works for me (mostly, it behaves badly for me due to my "selection"
option setting, but it surrounds without deleting at least). Maybe
there is a setting somewhere which interferes.

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