How do I highlight multiple words in vim?

3

There is a cool vim script: http://vim.wikia.com/wiki/Highlight_multiple_words

I found the script today. This script is what I want exactly.

It works well with gvim 7.2. (Both of Windows and Linux)
But I wish I can use it on linux shell too. Unfortunately it doesn't work.

Is it possible? Or is there another script we can use.

Thanks.

Benjamin

Posted 2010-06-01T06:25:16.477

Reputation: 1 849

I've found the alternative script.
http://www.vim.org/scripts/script.php?script_id=479

– Benjamin – 2010-06-01T07:29:27.877

Oops, I found another script. I think this is better one.
http://www.vim.org/scripts/script.php?script_id=1238

– Benjamin – 2010-06-01T08:50:58.350

@Benjamin: where do you put your downloaded scripts? – akira – 2010-06-01T11:03:32.563

@akira Linux, ~/.vim/plugin. Windows, C:\Program Files\Vim\vimfiles\plugin – Benjamin – 2010-06-01T15:09:22.837

@Benjamin: If you found something that answers your question, you can post it as an answer and accept it so others will have an easier time if they have this same issue. – Wuffers – 2011-01-25T02:46:52.997

@Mark: Should I answer at my question? I thought it's illegal. – Benjamin – 2011-01-25T05:18:45.710

@Benjamin: No, it's not illegal. It's fine to answer your own question if you've found something that fixed your question. – Wuffers – 2011-01-25T13:23:48.500

Answers

4

I found the script.

You can download the script at here.
http://www.vim.org/scripts/script.php?script_id=2666

Just \m on the word you want to highlight.
You could select visual block then \m
And you could add more colors.

enter image description here

Benjamin

Posted 2010-06-01T06:25:16.477

Reputation: 1 849

0

put the plugins under %USERPROFILE%\vimfiles. maybe put the unixish .vimrc to %USERPROFILE%\_vimrc.

akira

Posted 2010-06-01T06:25:16.477

Reputation: 52 754

Is the path important? I can't understand why do you recommend the path. Please explain more about that. – Benjamin – 2010-06-02T13:31:14.507

"Linux, ~/.vim/plugin. Windows, C:\Program Files\Vim\vimfiles\plugin" ... the path i mentioned is the windows equivalent for the linux one. on linux you put the files in your home, on windows you work on the global folders? bad bad bad behavior. – akira – 2010-10-03T08:45:45.647