Hi Benjamin, Hi Ben,

When I go to the menu->syntax->show filetypes in menu at the bottom of vim
window the calling statement appears as :cal SetSyn("c"). That it was how I
worked out the 'enable syntax' statement. So, then I execute my statement
as  :cal SetSyn("test.vim") and I have no error.

I thought the syntax is enabled (I had some highlighting effect). However,
having read Ben's email in 'default highlight' thread I realised that the
syntax is not enabled. I used Ben's syntax and everything is OK and works as
expected! No default highlight and problem with the new line anchor
disappear!

Cheers,

Kamil



On Wed, Dec 1, 2010 at 4:21 PM, Benjamin R. Haskell <[email protected]> wrote:

> On Tue, 30 Nov 2010, Kamil Libich 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?
>>
>
> Maybe case-sensitive?  See :help :syn-case
>
> Otherwise, an identical setup works here when specified manually with an
> open file.
>
> Where are you putting those commands?  If you're expecting highlighting and
> you use syntax highlighting otherwise, you should put them in a
> filetype-specific file:
>
> If you want it to be the only highlighting:
> %HOME%\vimfiles\syntax\filetype.vim
> == ~/vimfiles/syntax/filetype.vim
>
> If you want it to be in addition to normal highlighting:
> %HOME%\vimfiles\after\syntax\filetype.vim
> == ~/vimfiles/after/syntax/filetype.vim
>
> 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
> like:
> %HOME%\vimfiles\plugins\my-highlight.vim
> == ~/vimfiles/plugins/my-highlight.vim
>
> aug HighlightSetup
>        au!
>        au BufNewFile,BufReadPost,FileType,Syntax * call
> matchadd('Special','^Test')
> aug END
>
> --
> Best,
> Ben H
>
>
> --
> 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
>

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

Reply via email to