Question

I am curious how to get highlighting for RoR syntax. For instance the Gemfile is all one color and difficult to read.

Of the themes I did download I modified the .sss files to add syntax highlighting specifically for the Gemfile

string {
  color:#3adfb1;
}

string.gemfile {
  color:#fdc53d;
}

string.regex {
  color:#fdc53d;

saved, imported into Coda, but got nothing. Any help here would be appreciated.

Was it helpful?

Solution

You can set the syntax on a per-file basis by using the gear icon at the bottom of the editor window to select a Syntax Mode. That's great for new files that aren't saved yet or files with weird one-off extensions.

For something more permanent, you can specify a file extension to go with a syntax mode. This is under PreferencesEditorCustom Syntax Modes (at the bottom). Set the extension of the file, without the period (for example gem for ruby gem files) and the syntax mode you want to use for that file type (for example Ruby).

OTHER TIPS

I've made some improvements to the bundled Ruby.mode that ships with Coda 2. You can find it here: https://github.com/zenangst/Coda-2-Modes/

As per this guide:

1. Right click on Coda.app in /Applications and select Show Package Contents
2. Navigate to Contents/Resources/Modes/Ruby.mode/Contents/Resources
3. Open ModeSettings.xml
4. Add the following to the list of extensions.

<extension>ru</extension>
<filename>Gemfile</filename>
<filename>Guardfile</filename>
<filename>Procfile</filename>

Or, copy Ruby.mode to ~/Library/Application Support/Coda/Modes and then modify it, to preserve the original.

(For system-wide changes without modifying the application bundle, create the directory /Library/Application Support/Coda/Modes and put .mode directories there.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top