Tuesday, November 10, 2015

Re: write a very basic syntax file

>>
>> au BufRead,BufNewFile *.myfile setfiletype myfile
>
> It would be better, i.e., more likely to work as you expect, if you
> instead put this line in ~/.vim/filetype.vim



>> ~/.vim/plugin/syntax/myfile.vim, with content
>>
>> if exists("b:current_syntax")
>> finish
>> endif
>>
>> echom "Our syntax highlighting code will go here."
>>
>> let b:current_syntax = "myfile"
>
> This file should go into ~/.vim/syntax/,


OK... that worked. Thanks a lot !!
I guess I misread completely the documentation...

Now I only need to figure out how to highlight comments. But that
should be much easier.

Cheers,
Jose

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment