[Geany] Detecting user-defined filetypes?

Worth, Kevin kevin.worth at xxxxx
Tue Jun 19 18:25:36 UTC 2012


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



More information about the Users mailing list