Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99078

Create New Macro (Shortcut) to Copy Paste and Execute Code in the Integrated Terminal

$
0
0

The Problem

An operation I do a lot is to highlight/select code on the editors and then paste it on the integrated terminal to execute it. While I got pretty fast at using Ctrl + c, Ctrl + backtick, Ctrl + Shift + v and Enter, it's very annoying and repetitive. Is there a way to configure a macro or shortcut for this?

A Solution (failed) Attempt

This Github thread and this StackOverflow Question show how to create a shortcut to toggle between different Integrated Terminals. I would like for something similar to happen in my case (I used Ctrl + Shift + u in the example below), e.g.:

[
    { 
        "key" : "ctrl+shift+k", 
        "command" : "workbench.action.terminal.focusNext" 
    },
    { 
        "key" : "ctrl+shift+j", 
        "command" : "workbench.action.terminal.focusPrevious" 
    },
    { 
        "key" : "ctrl+shift+u", 
        "command" : "ctrl+c+ctrl+`+ctrl+shift+v+enter" 
    },
]

Viewing all articles
Browse latest Browse all 99078

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>