Insert new line with macros on Visual Code

The React Native Hot Reload on the device doesn't work fine all the time, according to the code you are working with, so we have to reload the app.

Therefore, I'm writing a code snipet to reload my android device always I save a file on Visual Code, like the RN hot reload.

I've seen this question that helped me

My doubt is: How can I add a command to my script to add a new line? Something like: editor.action.insertNewLine

Obs: I couldn't find a reference of this, if you have one to suggest I thanks.

"macros": {
    "runCommandInTerminal": [
        {
            "command": "cursorMove",
            "args": {
                "to": "wrappedLineEnd",
            }
        },
        "editor.action.insertNewLine",// command to add new line here
        {
            "command": "type",
            "args": {
                "text": "adb shell input text \"RR\" "
            }
        },
        {
            "command": "cursorMove",
            "args": {
                "to": "wrappedLineStart",
                "by": "wrappedLine",
                "value": 1,
                "select": true
            }
        },
        "workbench.action.terminal.runSelectedText",
        "editor.action.clipboardCutAction",
        "workbench.action.files.save",
    ],
}

Upvotes: 1

Views: 299

Answers (2)

barak
barak

Reputation: 919

This is it.

"editor.action.insertLineAfter" 

Thanks to Lucas

Upvotes: 0

After search and read the references I found a solution. If someone gets interested it's on my GitHub:

https://github.com/LucasMMota/hackings/blob/master/visual-code.md

Upvotes: 1

Related Questions