Skip to content

Instantly share code, notes, and snippets.

@caiodv
Created August 13, 2015 20:53
Show Gist options
  • Save caiodv/a79cad0e0ab3d736afb8 to your computer and use it in GitHub Desktop.
Save caiodv/a79cad0e0ab3d736afb8 to your computer and use it in GitHub Desktop.
Custom command to log a selected text in Atom.io (must be included in the init.coffee file)
atom.commands.add 'atom-workspace', 'custom:select_log', ->
editor = atom.workspace.getActiveTextEditor()
text = editor.getSelectedText()
editor.moveToEndOfLine()
editor.insertText("\nconsole.log('#{text}:', #{text})")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment