I'm new to vim and bumped into a problem.

Short question -- will vim tell me why it chose to highlight certain text in a certain way?

Long question --

I'm using vimdiff to compare two files, and the "DiffChange" highlight uses a purple background.

However, the files I'm diff'ing are puppet files, and there are quite a few possible highlights that show the text in the same purple color.

So what I'd really like to do is move to a specific character and have vim tell me "this character is subject to the following highlights" so that I know which one (for the text color) needs to be changed.

Is that possible?


from my .vimrc (all in one line):

nnoremap <M-i> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") ."> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>

move to your character and press Alt-i.

You may want to choose a different key for this mapping.

| improve this answer | |
  • What is the difference between hi, trans and lo – 0fnt Mar 4 '19 at 11:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.