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

How to declare multiple commands/macros #46

Open
psylion opened this issue Jan 10, 2019 · 1 comment
Open

How to declare multiple commands/macros #46

psylion opened this issue Jan 10, 2019 · 1 comment

Comments

@psylion
Copy link

psylion commented Jan 10, 2019

I tried to declare 2 macros command name, but got issues, "command not found"?

@ctf0
Copy link

ctf0 commented May 11, 2019

maybe like this

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

and u call it like

{
        "key": ";",
        "command": "macros.addSemicolonToLineEnd",
        "when": "editorTextFocus && editorLangId == 'php'"
    },
    {
        "key": ",",
        "command": "macros.addCommaToLineEnd",
        "when": "editorTextFocus && editorLangId == 'json'"
    },

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