Wednesday, December 1, 2010

Re: Problem with new line anchor in new syntax file

On Nov 30, 9:12 am, Kamil Libich <kamil.lib...@gmail.com> wrote:
> Hi,
>
> I'm using Vim 7.2 under XP x32
>
> I don't know why, the new line anchor seems not working in my syntax file
> which I'd like to prepare for myself.
>
> I want to highlight the 'Test' word which is at the beginning of the line.
> To do that I use:
>
> syn match tsTestName /^Test/
> highlight link tsTestName Special
>
> and it didn't highlight.
>
> Any suggestions?
>

1. Does Special have a highlight definition different than the
surrounding text?
2. Is this the only syntax rule you are applying? There are precedence
rules in :help :syn-priority

I have this mapping in my .vimrc to help debug syntax files:

nmap <F10>
\ :echo '<'.synIDattr(synIDtrans(synID(line('.'),col('.'),
1)),'name').'> from:' <bar>
\ let indent = '' <bar>
\ for syn_id in synstack(line('.'), col('.')) <bar>
\ echo indent.'<'.synIDattr(syn_id,"name").'>' <bar>
\ let indent .= ' ' <bar>
\ endfor <bar>
\ unlet indent<CR>

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