Jump to content
  • Announcements

    • spinynorman

      Mandriva Official Documentation

      Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.   Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.
    • paul

      Forum software upgrade   10/29/17

      So you may have noticed the forum software has upgraded !!!
      A few things that have changed. We no longer have community blogs (was never really used) We no longer have a portal page.
      We can discuss this, and decide whether it is needed (It costs money) See this thread: Here
Sign in to follow this  
fuzzylizard

How to clear a pattern match in vim?

Recommended Posts

I think this is programming related, anyway...

 

I was using vim last night to edit some programs and accidently typed in '/y'. Now the program is highlighting every y on the page. And to make things worse, this pattern matching persists beyond closing the program.

 

I am a vim newbie, how do I turn this off?

Share this post


Link to post
Share on other sites

Yep, I can pattern match anything and the annoying highlights just shift to the new pattern. And yea, it persists.

 

Very annoying. I will check out the link above for the answer.

 

 

No vim gurus out there?!?

Share this post


Link to post
Share on other sites
I think this is programming related, anyway...

 

I was using vim last night to edit some programs and accidently typed in '/y'. Now the program is highlighting every y on the page. And to make things worse, this pattern matching persists beyond closing the program.

 

I am a vim newbie, how do I turn this off?

 

Within the session, after a search you can remove the highlight by typing in command mode ":noh" , or faster, enter a new search which doesn't exist (ie: /adfasdfasd)

 

If you dislike the search highlighting and you want to remove that feature, then edit your ~/.vimrc file and append this: "set nohlsearch"

Share this post


Link to post
Share on other sites
Guest lahtris

put this in your .vimrc

 

nmap <SPACE> <SPACE>:noh<CR>

 

after you perform a search, pressing space in normal mode will still do what space did (usually advance one character), but also clear the highlighting. This way, you can leave the highlighting on if you want (by not hitting space).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×