Crystal support for the Geany editor.
See also the Crystal page of the Geany Wiki.
- Copy the filetype
cp filetypes.Crystal.conf ~/.config/geany/filedefs
- In the menu
Tools>Configuration Files>filetype_extensions.conf- In
[Extensions], addCrystal=*.cr;*.ecr; - In
[Groups]thenProgramming=, addCrystal;to the line
- In
- F5: Run
- F8: Build
- F9: Format
Don't forget to reload after formatting (Ctrl + R by default).
Crystal isn't supported officially by Geany, so another close language has to be chosen instead.
We have the choice of either Ruby or CoffeeScript, here are their pros/cons.
You can switch from one to another by modifying ~/.config/geany/filedefs/filetypes.Crystal.conf.
Configuration: [styling=Coffeescript] and lexer_filetype=CoffeeScript
- structs and enums can be collapsed
- heredocs are not highlighted (because JavaScript doesn't)
- macros syntax are OK
- methods and symbols aren't highlighted
- blue color for common methods and related keywords
Configuration: [styling=Ruby] and lexer_filetype=Ruby
- supports heredocs
- macro syntax not well supported, and usually mess up the rest of the file
- struct can't be collapsed
- standard and custom types are highlighted the same
See the Geany Wiki for more information about this configuration.
- @j8r Julien Reichardt - creator, maintainer