geddski / macros

macros support for VS Code
MIT License
165 stars 36 forks source link

Macro to find next/previous string #49

Closed robertmarkbram closed 3 years ago

robertmarkbram commented 5 years ago

Am trying to define macros that will that move the cursor to the next/previous space. My first go at this:

settings.json

    "macros": {
        "goNextSpace": [
            "actions.find",
            {"command": "type", "args": {"text": " "}}
        ]
    }

and keybindings.json

    {
        "key": "alt+shift+]",
        "command": "macros.goNextSpace"
    }

Naturally enough, this is opening the find text input, which I don't want.. it is also inserting a space.. Any clues how I can make a macro that will just go to the next space without requiring the text input - and how to make the corresponding previous version?

Also, when I hover the mouse over macros.goNextSpace in keybindings.json, I get a pop-up that says Value is not accepted. Valid values: ....

Rob :)

tberghuis commented 5 years ago

I was also not getting a simple macro to work. Tried the fork https://marketplace.visualstudio.com/items?itemName=ctf0.macros&ssr=false#overview which seems to do the job as expected.

robertmarkbram commented 5 years ago

Brilliant. I will try it

robertmarkbram commented 3 years ago

Got this to work using vscode-powertools at last