macros icon indicating copy to clipboard operation
macros copied to clipboard

How to declare multiple commands/macros

Open psylion opened this issue 6 years ago • 1 comments

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

psylion avatar Jan 10 '19 08:01 psylion

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'"
    },

ctf0 avatar May 11 '19 01:05 ctf0