Igor Pro Language Module for use in BBEdit
| rgilman | July 6, 2008 - 14:06 | ||||||
|---|---|---|---|---|---|---|---|
|
Attached is a Language Module plist for use in BBEdit. Here's the background: BBEdit (http://www.barebones.com/products/bbedit/) is one of the premiere programming-oriented text editors for the Mac with lots of great features -- including the ability to identify the functions in a code file, collapse and expand those function blocks, and color-code the keywords (e.g. built-in operation and function names). The catch is that BBEdit needs a Language Module file to do this for any particular language. I was not able to find any for Igor's programming language, so I made one and thought that others who use both Igor and BBEdit might appreciate it. To install, quit BBEdit if it is running put the file in Library/Application Support/BBEdit/Language Modules/ and then relaunch BBEdit. You may have to create the 'Language Modules' folder. Once installed you should find 'Igor Pro' included as one of the languages recognized by BBEdit. You should also go to the "Languages" preferences to provide the .ipf suffix mapping, to set '//' for the start of comments, and to set the colors you want to use in the color coding. Let me know if you find this useful or if you have any suggestions for improvements.
|
|||||||

Joined: 2007-08-14
Location: United States
Thanks! My test shows, this also works with TextWrangler.
It seems however not to detect a Static Function. Also, how can #pragma and # include lines be colored?
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
Joined: 2008-07-06
Location: United States
Thanks! My test shows, this also works with TextWrangler.
It seems however not to detect a Static Function. Also, how can #pragma and # include lines be colored?
Glad to hear it works with TextWrangler also.
I have attached an updated version (1.01) that detects Static Functions. It will now also color pragma and include as keywords (although it won't color the # in front of them).
I encourage you to open the file and take a look if you haven't already.
The coloring is just based on a long list of keywords taken from the pdf version of the manual. Perhaps someone on this list might know how to get the #'s properly coded so that they can be colored also.
The detection of the Functions is handle by a regular expression that could be tweaked further if needed.
Hope that helps.
Joined: 2007-03-01
Location: United States
The coloring is just based on a long list of keywords taken from the pdf version of the manual. Perhaps someone on this list might know how to get the #'s properly coded so that they can be colored also.
You might find that writing a quick Igor script that includes calls to FunctionList() and OperationList() might make it easier to build a new file when Igor changes, since then you wouldn't have to manually look through the manual. I've used a similar method to build the syntax information file that is used for the code highlighting on the IgorExchange site.
Joined: 2008-01-04
Location: France
Just an epsilon incremental improvement. I corrected a typo static was written staic....
and added a line which makes the strings to be colored. To be honest just copied from an example from BBedit (C++ codeless..) it appears to work. Attached is the modified version. Enjoy!
Bela