Monday, August 23, 2010

Re: Visual selection not working ?

On 08/23/2010 09:47 PM, Aaron Lewis wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
> Assuming a typo ,
>
> char test [] = { a , b , c , d }; // should be { 'a' , 'b' , 'c' }
>
> Now i need to make the correction.
>
> So i pressed v , select from '{' to '}' , typed in command s/\w/'&'/g (
> '<,'> is automatically added ) , and all of the character was wrapped
> with quotes , why ?
>
> If i removed /g , the first character 'c' was quoted.
>
> Did i make any mistakes here ?

No mistake, but you apparently did not know that s command works on the
whole line, always, as far as I know. -ak

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