Skip to content

Instantly share code, notes, and snippets.

@z-------------
Created August 15, 2015 03:07
Show Gist options
  • Save z-------------/197fdbd7339814dd5d3e to your computer and use it in GitHub Desktop.
Save z-------------/197fdbd7339814dd5d3e to your computer and use it in GitHub Desktop.
Set the tab length to 2 for all .dart files, as per the style conventions. For Atom editor.
path = require "path"
atom.workspace.observeTextEditors (editor) ->
if path.extname(editor.getPath()) is ".dart"
editor.setTabLength(2)
console.log "set tab length to 2", editor
else
tabLength = atom.config.get "editor.tabLength" || 4
editor.setTabLength(tabLength)
console.log "set tab length to " + tabLength, editor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment