I wanted at least some basic syntax highlighting for protocol buffers (http://code.google.com/p/protobuf/) files, so I simply copied filetypes.c to ~/.config/geany/filetypes.proto.conf and changed the following lines:
[keywords] primary= import message enum service extend required optional repeated rpc returns option extensions to secondary= double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes default java_package java_outer_classname optimize_for cc_generic_services java_generic_services py_generic_services message_set_wire_format packed deprecated
[settings] extension=proto lexer_filetype=C #protobuf is C-like enough that this works ok, maybe there are better choices...
This works well enough, but when I open a .proto file, I have to manually select Document->Set Filetype->proto file. I tried adding a line to /usr/share/geany/filetype_extensions.conf, but that doesn't seem to make geany use my filetypes.proto.conf when I open a .proto file.
The docs are a little obtuse in how they explain some of this; a step-by-step would be helpful.
Also if anyone knows of work that's been done to create a protobuf lexer and tags for geany, I'd love to know.
-Kevin
Hi,
Le 19/06/2012 20:25, Worth, Kevin a écrit :
I wanted at least some basic syntax highlighting for protocol buffers (http://code.google.com/p/protobuf/) files, so I simply copied filetypes.c to ~/.config/geany/filetypes.proto.conf and changed the following lines:
[keywords] primary= import message enum service extend required optional repeated rpc returns option extensions to secondary= double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes default java_package java_outer_classname optimize_for cc_generic_services java_generic_services py_generic_services message_set_wire_format packed deprecated
[settings] extension=proto lexer_filetype=C #protobuf is C-like enough that this works ok, maybe there are better choices...
comments at the end of line doesn't work in the filetypes configuration file. make sure your comment is on it own line.
This works well enough, but when I open a .proto file, I have to manually select Document->Set Filetype->proto file. I tried adding a line to /usr/share/geany/filetype_extensions.conf, but that doesn't seem to make geany use my filetypes.proto.conf when I open a .proto file.
The docs are a little obtuse in how they explain some of this; a step-by-step would be helpful.
I guess you added
Proto=*.proto;
to filetype_extensions.conf? If yes, either remove the uppercase P on the langauge name or rename the filetype file as filetypes.Proto.conf (with the uppercase P). These two must match exactly or it won't work.
BTW, you don't need to edit the system's filetype_extensions.conf, just copy it to your homedir and modify this one, or use the "Tools->configuration files" facility.
Regrads, Colomban
Also if anyone knows of work that's been done to create a protobuf lexer and tags for geany, I'd love to know.
-Kevin
Tools->Config files->filetype_extensions.conf opened the one in /usr/shared (presumably because the one in my home dir didn't exist) Created a new one with
[Extensions] proto=*.proto;
and it works just fine
Also the end-of-line comment was added in my email, wasn't in my actual config file, I suspected it might not work :)
Thanks! Kevin
-----Original Message----- From: geany-bounces@uvena.de [mailto:geany-bounces@uvena.de] On Behalf Of Colomban Wendling Sent: Tuesday, June 19, 2012 11:49 AM To: geany@uvena.de Subject: Re: [Geany] Detecting user-defined filetypes?
Hi,
Le 19/06/2012 20:25, Worth, Kevin a écrit :
I wanted at least some basic syntax highlighting for protocol buffers (http://code.google.com/p/protobuf/) files, so I simply copied filetypes.c to ~/.config/geany/filetypes.proto.conf and changed the following lines:
[keywords] primary= import message enum service extend required optional repeated rpc returns option extensions to secondary= double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes default java_package java_outer_classname optimize_for cc_generic_services java_generic_services py_generic_services message_set_wire_format packed deprecated
[settings] extension=proto lexer_filetype=C #protobuf is C-like enough that this works ok, maybe there are better choices...
comments at the end of line doesn't work in the filetypes configuration file. make sure your comment is on it own line.
This works well enough, but when I open a .proto file, I have to manually select Document->Set Filetype->proto file. I tried adding a line to /usr/share/geany/filetype_extensions.conf, but that doesn't seem to make geany use my filetypes.proto.conf when I open a .proto file.
The docs are a little obtuse in how they explain some of this; a step-by-step would be helpful.
I guess you added
Proto=*.proto;
to filetype_extensions.conf? If yes, either remove the uppercase P on the langauge name or rename the filetype file as filetypes.Proto.conf (with the uppercase P). These two must match exactly or it won't work.
BTW, you don't need to edit the system's filetype_extensions.conf, just copy it to your homedir and modify this one, or use the "Tools->configuration files" facility.
Regrads, Colomban
Also if anyone knows of work that's been done to create a protobuf lexer and tags for geany, I'd love to know.
-Kevin
_______________________________________________ Geany mailing list Geany@uvena.de https://lists.uvena.de/cgi-bin/mailman/listinfo/geany