Friday, September 24, 2010

RE: How to highlight different keywords with different colors?

-----Original Message-----
From: vim_use@googlegroups.com [mailto:vim_use@googlegroups.com] On
Behalf Of Stahlman Family
Sent: Friday, September 24, 2010 7:54 PM
To: vim_use@googlegroups.com
Subject: Re: How to highlight different keywords with different colors?

robert song wrote:
> Hi, everyone.
>
> Sometimes it's useful to display different keywords in different
> colors, here I can use * to highlight the word under cursor, but how
> to highlight the other keywords in some other colors at the same time
?

Have you tried Txtfmt (The Vim Highlighter)?

http://www.vim.org/scripts/script.php?script_id=2208

It's a token-based highlighter that lets you set the
foreground/background color, as well as the format attributes (bold,
underline, italic, etc...) of arbitrary text regions. Highlighting is
accomplished with tokens inserted by intuitive mappings, and as of Vim
7.3 (and Txtfmt 2.4), the tokens are *completely* concealed, so they
don't change the appearance of the document. (Before the "conceal"
feature was added to Vim, each token looked like a single space.)

Note that the 3 types of tokens (fg color, bg color, format) are
"orthogonal", so the same piece of text could be (e.g.) bold-italic, red

text on blue background. Of course, if you want to change foreground
color only, you can do that too. In fact you can disable colors
selectively to avoid creating highlight regions for
foreground/background colors you don't need. The fg/bg colors are
independently configurable with options, and you can enable up to 8 of
each.

Sincerely,
Brett Stahlman

>
> Best Wishes,
> robert
>


Hello
This Txtfmt seems great for personal color strategy. However, I
tried to
Install this into two computer, both failed with many many many error
once i
Run "set filetype=txtfmt" in command mode or trigger with modeline. My
gvim
Is the version of 7.3. in order to avoid the conflict with other
scripts, i
Uninstall gvim and then install without anyone script tool. But still
failed
To run this tool "txtfmt".
Anyone have a similar experience with it ?

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