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

VS Code - Key bindings - cursor position for *type* command

$
0
0

I am using VS Code Version: 1.40.0.

for quicken up my development I would need to set my own keybinding for entering a certain text ("{|print_x}") into the code. I managed to do that, but even better would be if the type cursor would jump right after "{" as soon as I'd paste the text.

So: {here type curosor|print_x}.

Code in keybindings.json:

 { 
    "key": "shift+alt+y", 
    "command": "type",
    "args": { "text": "{|print_x}", },
    "when": "editorTextFocus" 
}

I thought using an array like that might work, but unfortunately text argument needs to be string.

"args": { "text": [ "{" , "|print_x}" ], }

Is there a way to do it? If so, I would be very thankful.


Viewing all articles
Browse latest Browse all 97371

Trending Articles



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