[GUIDE] Shared Atom configuration

[GUIDE] Shared Atom configuration main picture
JAN12

First of all we want to say thank you to all contributors of Atom code editor as well as all package developers for this awesome software development tool. This people developed and keep extending great code editor with highly customizable interface and huge amount of packages. Thanks to all of you for hard work!

Why?

When you work on your "next big thing" mobile, desktop or web application, at some point, you will need help from the outside, other developers will come in and will start to code in their style with their editor configuration. That's the time when the codebase will get really messy. And messy code leads to more bugs, makes code less readable, makes it harder to implement new features and fix bugs. Different indentations, spaces vs. tabs, /* Comments */ vs // Comments, /** Documentation */ vs /// Documentation, add line breaks to the end file or not, how to unwrap closures, name variables/functions/methods/procedures, loop through arrays and many many other problems will arise. Sharing common editor configuration solves part of this problems by making your code look like one person wrote it with following strict conventions.

How do we use Atom at App Dev Academy?

Ruby on Rails

First of all we use it for Ruby 0n Rails which is supported by default out of the box. As HTML templates language for RoR projects we use Slim, support of Slim DSL (domain specific language) comes with package ruby-slim.

Our choice for testing Ruby on Rails apps is RSpec, handy RSpec support comes with package ruby-test.

React.js with ES6

This works out of the box.

Swift

Sometimes it's easier to open single Swift source code file with Atom. For Swift language support we use package called language-swift.

Configuration of Atom at App Dev Academy

Packages

  • platformio-ide-terminal - to open bash terminal inside of editor
  • git-time-machine - for visual interaction with git commit history, cool for watching diffs
  • language-swift - for Swift language support
  • ruby-slim - for Slim templates support in Ruby on Rails projects
  • ruby-test - for testing Ruby on Rails applications, includes ability to run TestUnit, Rspec and Cucumber tests

Config - config.cson

"*":
  core:
    ignoredNames: [
      ".DS_Store"
      ".bundle"
      ".rspec"
    ]
    telemetryConsent: "limited"
  editor:
    fontSize: 17
    showInvisibles: true
    tabType: "soft"
  "exception-reporting":
    userId: "YOUR_USER_ID_FOR_EXCEPTION_TRACKING"
  "platformio-ide-terminal":
    core: {}
    style:
      defaultPanelHeight: "400px"
  "ruby-test":
    rspecAllCommand: "rspec --tty spec -f doc --color"
  "split-diff":
    diffWords: true
    ignoreWhitespace: true
    leftEditorColor: "red"
    rightEditorColor: "green"
    syncHorizontalScroll: true
  "tree-view":
    hideIgnoredNames: true
  welcome:
    showOnStartup: false
  whitespace:
    ignoreWhitespaceOnCurrentLine: false
    ignoreWhitespaceOnlyLines: true

Key mappings - keymap.cson

'.editor':
  'cmd-i': 'window:toggle-invisibles'
'atom-text-editor':
  'cmd-`': 'platformio-ide-terminal:toggle'
'atom-workspace':
  'cmd-shift-E': 'ruby-test:toggle'
  'cmd-shift-R': 'ruby-test:test-all'