On Thursday, July 11, 2013 9:48:30 AM UTC-5, Pritesh Ugrankar wrote:
> Hi,
> 
> 
> 
> I am using gvim version 7.3 32 Bit on 64 Bit Windows 7.
> 
> 
> 
> After I use the command ":%s/ /,/g" which basically replaces every instance
> 
> of space with a comma, the replacement works fine. 
> 
> 
> 
> However, right after that, if I press "u" to undo the replacement, it does
> 
> replace the "," with space, however, for some reason, it highlights the
> 
> space.
> 
> 
> 
> My _vimrc has highlighting enabled.
> 
> 
> 
> Is this a feature or a bug? Not that its causing a big issue, just that so
> 
> many highlights sort of become an eyesore.
> 

Whenever you use an :s command, it sets the last search pattern just like 
searching with / will set the last search pattern.

If you have 'hlsearch' set in your .vimrc, Vim will always highlight the last 
search pattern.

So if you do a global substitute, then undo the substitution, then everywhere 
the substitute matched now matches the last search pattern and gets highlighted.

It's a feature. One you enabled in your .vimrc.

> 
> 
> Any help or suggestion will be helpful.
> 

After undoing the change, just issue the command :nohlsearch. This temporarily 
turns off search highlighting (until your next search). You could even map a 
key to do that if you do it a lot.

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to