Tuesday, September 1, 2009

Applying highlighting matches to second column only?

Hi,
I'm trying to highlight specific letters in words in a specific column.
I have a file looking like this

word_1 long_word_1
word_2 long_word_2
word_3 long_word_3
...

where word_n are all different and of varying (or equal) length, and
long_word_n are all different but of the same length. word_n and
long_word_n are separated by white space.

I want to highlight every letter, e.g., 'A', in long_word_n, but not in
word_n.

Question: How do I limit my match to apply to only the second column?

My current code (below) is too greedy -- the match is on every
occurrence of A (or a) in each line.

Current code:

syn match myA "[Aa]\+"
highlight myA guifg=black guibg=yellow

Cheers
/JN


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

No comments: