Skip to content

Instantly share code, notes, and snippets.

@stevehorn
Created February 14, 2011 20:40
Show Gist options
  • Save stevehorn/826502 to your computer and use it in GitHub Desktop.
Save stevehorn/826502 to your computer and use it in GitHub Desktop.
Autohotkey For empty anonymous function
;Executed by typing fx<space>
:*:fx ::
;Send left curly
SendEvent function() {{}
Send {Enter}
;Send right curly
SendEvent {}}
Send {Up}
Send {End}
Send {Enter}
return
==============
prints:
function() {
/*Cursor lands here*/
}
@coreyhaines
Copy link

You should add a newline after the end, so the cursor ends up on the next line. Don't have your first statement be on the same line as the function declaration. :)

@stevehorn
Copy link
Author

Corey, right you are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment