Skip to content

Instantly share code, notes, and snippets.

@liddiard
Created February 10, 2015 23:28
Show Gist options
  • Save liddiard/ae16bd7092fc2c5738c5 to your computer and use it in GitHub Desktop.
Save liddiard/ae16bd7092fc2c5738c5 to your computer and use it in GitHub Desktop.
GitHub Atom editor config scripts
# use two-space tabs for JavaScript
path = require 'path'
atom.workspaceView.eachEditorView (editorView) ->
editor = editorView.getEditor()
filepath = editor.getPath()
# set Tab Length for JS sources
if path.extname(filepath) is '.js'
editor.setTabLength(2)
@liddiard
Copy link
Author

atom.workspaceView is apparently deprecated. Replacing it with suggested atom.views.getView(atom.workspace) resulted in undefined is not a function error, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment