2

I've been trying to get Sublime Text 3 set up to learn Ruby and RoR. Everything I've read has said to set it up with Railscasts Colour Scheme. I was under the impression that this would provide syntax highlighting. Unfortunately, all I have is white text on a dark gray background.

Am I missing something? Did I do something wrong?

0

2 Answers 2

4

2 things you can check:

1) Do the files you are opening have the .rb extension?

2) Have you selected Ruby as the syntax in the "View" dropdown at the top? (for osx, your dropdown might be in a slightly different section)

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

This was it, in a roundabout way. I didn't have any of those defaults because I had removed them while trying to clean things up. I ended up removing the application and installing fresh.
@theillien if it's resolved you should mark correct :)
0

I have a couple of suggestions for a better RoR coding experience. First, instead of using Sublime's default Ruby syntax, I'd suggest installing the Ruby on Rails TextMate bundle to get several Rails-specific syntax highlighting definitions that have additional scopes. To install, switch to your Packages directory on the command line (in Sublime, select Preferences -> Browse Packages... to find the directory on your system), then run

git clone https://github.com/drnic/ruby-on-rails-tmbundle.git "Ruby on Rails"

Next, instead of using the Railscast color scheme, you may want to check out the Neon Color Scheme (full disclosure: I'm the maintainer), available via Package Control. Neon, unlike many other color schemes, has many specific rules for a number of different languages, including Ruby and RoR. As an example, here's the code from Mike Slutsky's answer using Railscast:

Railscast

and the same code with Neon:

Neon

Of course, it's completely up to you which one you use, and some people get distracted by having too many different colors on the screen, but I find my understanding of code (either mine that I haven't looked at in a while, or that written by other people) is improved with more highly-specific highlighting. YMMV, of course.

4 Comments

Thought I'd come back and give some feedback on this. While I appreciate the suggestion, I can't help but think that your post is nothing more than an advertisement. That said, the colors in your scheme are far too bright for me.
@theillien I clearly indicated that I am the package's maintainer, and I truly though it might be helpful in this situation - all in accordance with the community's guidelines on using your own projects in an answer. It's open-source, and I don't make any money off of it, so there's no profit motive. I genuinely find it useful for my coding (that's why I developed it), it's rather popular on Package Control, and I've gotten a lot of positive feedback from users, so I thought I'd mention it. (...)
(...) I also appreciate your feedback about the brightness, I'll take that into consideration if I develop a more muted version. There are definitely people that try to advertise on SO through their answers - just search Meta Stack Overflow, examples are all over the place. They tend to do keyword searches for target questions, and copy-paste their answers with very little variation or concern for what the OP is actually asking, or if their product or service is even relevant for the situation. (...)
(...) Yes, I've mentioned this and another popular project I maintain for Sublime before, but they're probably in less than 2% of my answers, and only if very relevant to the situation at hand and could genuinely address the OP's concerns. As far as the folks at Stack Exchange and the user community is concerned, this is perfectly fine as long as the guidelines I linked above are followed. If my suggestion didn't work for you, that's fine, but please understand what's advertising and what's acceptable behavior. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.