-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Ryan Jones edited this page Aug 4, 2015
·
7 revisions
Atom-Macros wiki!
This is the place to share your macros and your experiences with this plugin...
Examples, included in the source
This one is very similar to Vim's *
command.
findWordUnderCursor = (direction) ->
if !getActiveTextEditor().getSelection().getText()
dispatchEditorCommand 'editor:select-word'
dispatchEditorCommand 'find-and-replace:use-selection-as-find-pattern'
dispatchEditorCommand direction
@findNextWordUnderCursor = ->
findWordUnderCursor 'find-and-replace:find-next'
@findPreviousWordUnderCursor = ->
findWordUnderCursor 'find-and-replace:find-previous'
# keymap.cson
'atom-text-editor:not([mini])':
'cmd-p': 'macros:insert'
# macros.coffee
@insert = ->
editor = getActiveTextEditor()
editor.insertText("this text will be inserted into your current editor")