On Fri, Aug 7, 2009 at 10:50 AM, Charles Campbell <
[email protected]> wrote:

>
> KKde wrote:
> >> The cmd can be pretty much any Ex command; a popular one is to do
> >> substitutes, such as
> >>
> >> :'<,'>B s/onething/foranother/
> >>
> >> You can get vis.vim from:
> >>
> >>    http://vim.sourceforge.net/scripts/script.php?script_id=1195 (stable)
> >>    http://mysite.verizon.net/astronaut/vim/index.html#VIS
> >> (cutting edge)
> >>
> >
> > I didn't understand why there is a need of separate B command. When I
> > visually select text and press :  then the cursor goes to command line
> > and the ex commands can be executed on that text. Can you justify plz?
> >
> You'd said you were using visual block (initiated with ctrl-v); there's
> also V (visual line) and v (visual).  Even if you select a visual block,
> and then do a ":command", that :command will apply to all the lines of
> the visual block; ie. the action will not take place solely inside the
> visual block.  With substitute there are (relatively new) regex-atoms
> that allow one to specify applicability column extents, etc, but they
> don't get into your substitute automatically.  As an example:
>
> 111222111222111
> 111222111222111
> 111222111222111
>
> Consider using visual-block (ie. ctrl-v) to select the rightmost block
> of "2"s, and changing them to "3"s.
>
> <select rightmost block of "2"s>
> :s/2/3/g
>
> The result:
>
> 111333111333111
> 111333111333111
> 111333111333111
>
> The substitute was not restricted just to the visual block.  With the
> vis.vim plugin, a
>
> <select rightmost block of "2"s>
> :B s/2/3/g
>
> yields
>
> 111222111333111
> 111222111333111
> 111222111333111
>
> Regards,
> Chip Campbell
>
>
> >
>

I've installed the vis plugin and it worked as needed. Thanks for the help.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to