Created
July 5, 2017 21:53
-
-
Save lexjacobs/c1062b8851bb6ee1b6d76b1b03bf7461 to your computer and use it in GitHub Desktop.
atom init script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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