119343Re: Problem with new line anchor in new syntax file
- Dec 1, 2010On Tue, 30 Nov 2010, Kamil Libich wrote:
> Hi,Maybe case-sensitive? See :help :syn-case
> 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?
Otherwise, an identical setup works here when specified manually with an
Where are you putting those commands? If you're expecting highlighting
and you use syntax highlighting otherwise, you should put them in a
If you want it to be the only highlighting:
If you want it to be in addition to normal highlighting:
Using 'test' in place of 'filetype' in those names, putting your
commands in there and calling :set ft=test from another file worked.
If you want the highlighting regardless of filetype, you can use the
'matchadd()' function, and add the following to your vimrc or something
au BufNewFile,BufReadPost,FileType,Syntax * call matchadd('Special','^Test')
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
- << Previous post in topic Next post in topic >>