Hi,

First, some background.

At my work I spend a lot of time editing data files in CSV format.
Because some of the lines can have many empty fields (it's not unusual
to have 20+ empty fields consecutively) I've developed a function which
allows me to toggle highlighting of every 5th and 10th field.

The way I do this is quite simple - I modified the csv.vim syntax file
so it only had 10 fields, and when I'm toggling 'on' the highlighting I
simply use 'hi col04 cterm=inverse' (or col09 for every 10th field).
However, I couldn't find a simple way to reverse this. If I use 'hi
clear col04' it removes all highlighting, obviously.

I can't hard-code the colors in my function, because the colors used
might change in the future, or one of my colleagues might use this
function and I don't want to have to remember to change this function
every time.

What I ended up doing is saving the foreground and background colors,
doing a 'hi clear', then setting the colors again. This way does at
least mean that anyone can use it, no matter what color settings they
are using.

What I'd like is some way to reverse the 'cterm=inverse' -
'cterm=normal' would be ideal, but 'normal' isn't a valid option for
cterm.

I might take a look at the code myself and see if I can work out how to
do it, but if there's an easy way I've missed I'd appreciate being
informed of it.

Spencer

-- 
<<< Eagles may soar, but weasels don't get sucked into jet engines >>>
7:23am up 44 days 14:05, 20 users, load average: 0.35, 0.15, 0.07
Registered Linux User #232457 | LFS ID 11703

Reply via email to