Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Custom File Types
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

mreuvers
New Member

Netherlands
3 Posts

Posted - Mar 09 2004 :  07:44:00 AM  Show Profile
Hi,

It would be very handy to add additional filetypes to VA. For instance it now only recognizes C/C++ like files, but if I want to edit in Vstudio my own filetype, no syntax highlighting will be present. Is there a way to define your own keywords, comments etc and link that to a certain filetype?

For instance:

filetype = *.abc; *.bde
startcomment_1 = ;
endcomment_1 =
startcomment_2 = #
endcomment_2 = #
startcommentblock_1 = /*
endcommentblock_1 = */
startstring_1 = "
endstring_1 = "

keywords
{
dowhile
whileend
for
then
}

etc etc

And that VA will recognise these settings when this kind of file is opened..

Regards,

Martijn

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Mar 09 2004 :  10:54:08 AM  Show Profile
Somone else asked this just a few days ago -- thread #1599.

Personally, I suspect you're underestimating the amount of work which is required to syntax-colour a file correctly. Try editing in emacs Perl mode to see how annoying it is when it's only 95% right.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Mar 10 2004 :  11:40:20 AM  Show Profile
i have written some very simple syntax highlighting rules for vim 6. if you stick to matching whole words and simple regular expressions it isn't to hard, assuming you have a suitable syntax parser available to you.

the real problems start when you want to detect ranges and blocks. updating the syntax rules for #if 0, #else, #endif was an exercise in trial and error

zen is the art of being at one with the two'ness
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Mar 10 2004 :  11:53:09 AM  Show Profile
Spotting built-in keywords and comment blocks is fairly easy. (Although emacs gets even this wrong in Perl, because hash inside a regexp doesn't start a comment -- unless the regexp is //x, when it does).

But what about colouring variables, for example? Or don't you care about those?

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000