Multiple search in vim

2009-11-19 156 words 1 min read

I was looking at a log file and needed to highlight multiple search items to make the logs more readable. I got into multiple threads suggesting various cryptic vim commands but I was in no mood to remember them. So, I finally hit <a href="http://www.vim.org/scripts/script.php?script_id=479" target="_blank">this.

This is a cool vim script which you can use to highlight multiple search patter. You can simply add a search term by doing

<img style="vertical-align: bottom;" src="http://sc.webmessenger.msn.com/10.1.0323.0/session/images/emoticons/smile_confused.gif" alt=":S" />earch

By default it is configured to have four colors but you can change that. Also when you want to reset the search you can simply do:

<img style="vertical-align: bottom;" src="http://sc.webmessenger.msn.com/10.1.0323.0/session/images/emoticons/smile_confused.gif" alt=":S" />earchReset<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://wknight8111.blogspot.com/2009/10/text-edior.html">Text Edior (wknight8111.blogspot.com) <li class="zemanta-article-ul-li"><a href="http://www.slumpedoverkeyboarddead.com/2009/08/06/vim-video-tutorial/">VIM video tutorial (slumpedoverkeyboarddead.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/47b68779-3396-426c-9b94-21da708a3b5a/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e7.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">


author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it