Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to get Ruby syntax highlighting in PHPStorm?

Tags:

php

ruby

phpstorm

I found this but honestly not sure how to install it or whether it applies. Thanks!

like image 718
jcroll Avatar asked May 08 '13 22:05

jcroll


2 Answers

Ruby plug-in that you have linked is designed for IntelliJ IDEA Ultimate only, it will not work with PhpStorm. See this answer for more details.

However, it's possible to get the basic syntax highlighting for Ruby files in PhpStorm using the TextMate bundles support plug-in. It's already included with PhpStorm 6.0.1 and you don't need to install it, just make sure it's enabled in Settings | Plugins.

  1. Git clone Ruby.tmbundle into some directory.

  2. Add this directory in Settings | TextMate Bundles:

Ruby bundle

For some reason PhpStorm TextMate Bundles support will not recognize *.rb files as supported by this bundle. To fix this problem open Ruby.tmbundle\Syntaxes\Ruby.plist file in some text editor, find <key>fileTypes</key> section, add <string>rb</string> under <array>

(the above should be fixed in the latest Ruby bundle version, so the editing the bundle is no longer needed, but if you are adding some other language bundle, it's something you may need to adjust)

Restart PhpStorm, verify that *.rb is now associated correctly:

association

Now you get Ruby syntax highlighting in PhpStorm:

Ruby syntax


If you need full support for both Ruby and PHP (plus much more) in a single IDE, consider using IntelliJ IDEA Ultimate.

like image 112
CrazyCoder Avatar answered Oct 11 '22 20:10

CrazyCoder


CrazyCoder's git repo doesn't work in windows systems, as a large number of the filenames are invalid in Windows.

I have, however, found the official repo for ruby for textmate:

https://github.com/textmate/ruby.tmbundle

like image 29
Populus Avatar answered Oct 11 '22 18:10

Populus