Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output text as part of macro #8

Closed
lumpysimon opened this issue Feb 16, 2017 · 3 comments
Closed

Output text as part of macro #8

lumpysimon opened this issue Feb 16, 2017 · 3 comments

Comments

@lumpysimon
Copy link

Is it possible to output a string to the editor as part of a macro? I don't want to ask for input from the user, just output a string that is defined in the macro.

For example, to go to end of line and add a semi-colon, I've got this but it doesn't work:

"macros": {
    "eolSemiColon": [
        "cursorEnd",
        ";"
        ]
    }
}
@geddski
Copy link
Owner

geddski commented Feb 22, 2017

Yep it supports that no problem. You just specify an object instead of a string, and the text you want it to type:

"macros": {
    "eolSemiColon": [
        "cursorEnd",
        {"command": "type", "args": {"text": ";"}}
        ]
    }
}

@geddski geddski closed this as completed Feb 22, 2017
@lumpysimon
Copy link
Author

Brilliant thank you, that works perfectly

@geddski
Copy link
Owner

geddski commented Feb 27, 2017

@lumpysimon you bet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants