Setting up Atom for Rails development

On a recent development project we chose Atom as editor (instead of our regular Sublime). Here’s how to install it and some tips on what packages to install.

brew install caskroom/cask/brew-cask
brew cask install atom

Next use the Atom Package Manager (apm) to install some packages.

apm install linter # Base linter
apm install linter-ruby
apm install linter-scss-lint
apm install linter-coffeelint
apm install linter-rubocop
apm install linter-haml
# nicer code
apm install atom-beautify
apm install atom-css-comb
# testing
apm install ruby-test
apm install cucumber
apm install cucumber-step # open the step definition
# language highlighting
apm install language-rspec
apm install language-haml
apm install language-docker
# other
apm install minimap # Shows you a tiny preview of the file on the right
apm install Sublime-Style-Column-Selection # Allows you to select columns
apm install toggle-quotes
apm install trailing-spaces
# for extra credit
apm install color-picker
apm install git-blame

Install dependencies for some of the packages.

gem install scss-lint
gem install rubocop
gem install coffee-script
npm install -g coffeelint
rbenv rehash # if you use rbenv

Edit your Atom config (~/.atom/config.cson).

Needed to make ruby-test and various linters find the correct executables. Check what paths you need.

  specFramework: "rspec"
  rspecAllCommand: "bundle exec rspec --tty spec"
  rspecFileCommand: "bundle exec rspec --tty {relative_path}"
  rspecSingleCommand: "bundle exec rspec --tty {relative_path}:{line_number}"
  cucumberAllCommand: "bundle exec cucumber --color features"
  cucumberFileCommand: "bundle exec cucumber --color {relative_path}"
  cucumberSingleCommand: "bundle exec cucumber --color {relative_path}:{line_number}"
  command: "/Users/[yourname]/.rbenv/shims/rubocop"