Skip to content

Instantly share code, notes, and snippets.

@lexjacobs
Created July 5, 2017 21:53
Show Gist options
  • Save lexjacobs/c1062b8851bb6ee1b6d76b1b03bf7461 to your computer and use it in GitHub Desktop.
Save lexjacobs/c1062b8851bb6ee1b6d76b1b03bf7461 to your computer and use it in GitHub Desktop.
atom init script
atom.commands.dispatch(atom.views.getView(atom.workspace), 'voicecode:connect')
# enables "shift-space" to move through closing matched brackets
SymbolRegex = /\s*[(){}<>[\]/'"]/
atom.commands.add 'atom-text-editor', 'custom:jump-over-symbol': (event) ->
editor = atom.workspace.getActiveTextEditor()
cursorMoved = false
for cursor in editor.getCursors()
range = cursor.getCurrentWordBufferRange(wordRegex: SymbolRegex)
unless range.isEmpty()
cursor.setBufferPosition(range.end)
cursorMoved = true
event.abortKeyBinding() unless cursorMoved
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
# console.log "Saved! #{editor.getPath()}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment