On Fri, Jan 20, 2012 at 2:35 AM, thomas.puech@snecma.fr wrote:
Hello
I am using Red Hat 5, and I would like to use Geany for editing text files for a very specific purpose (data files used for defining numerical simulations). As such, I need to define a whole new configuration file with specific keywords for syntax highlighting as well as code folding or for the tags of the symbol list.
As I understood from the documentations of the release 0.20, it is very easy to modifiy an existing configuration file, but it seems to be harder to build a new configuration file from scratch and include it in the Geany interface (not in place of an existing one, but as a new one added to the available language choices).
Please could you tell me if this is feasible, and if so, how ?
I'm presuming that you mant syntax highlighting. To do that you need to have more than just the filetype file. How much depends on your target language:
1. you need lexical analyser code in the Scintilla editing widget Geany uses and a mapping in sciwrappers.h from the states the lexer determines to the style names that are used in filetype files
2. you need to add a new filetype to Geany in filetypes.c and add the extensions to filetypes.extensions
3. you need a filetypes file
But there are shortcuts
1. if you can use the lexer from a language already in Geany then you only need a custom filetype, see the manual.
2. if you can use a lexer already in scintilla but not included in Geany you only need the wrappers and filetypes.c additions. Follow the examples of existing languages.
Otherwise you need to write the C++ code for the lexer and add it to Scintilla first.
Its all possible, but how much work depends on the level you need.
Cheers Lex