-
Notifications
You must be signed in to change notification settings - Fork 0
/
keybindings.jsonc
executable file
·12 lines (12 loc) · 1.1 KB
/
keybindings.jsonc
1
2
3
4
5
6
7
8
9
10
11
12
[
{ // Run the ./.vscode/run.sh in terminal, passing it the name of the current file if it exists
// Also, search through parent directories to see whether there is a .vscode/run.sh there
"key": "shift+enter",
"command": "workbench.action.terminal.sendSequence",
"when": "editorTextFocus",
"args": {
// "text": "\u0003bash -c 'FILE=\"${file}\"; PWD=$(dirname \"$FILE\"); SCRIPT=\".vscode/run.sh\"; echo \"FILE = $FILE\"; echo \"PWD = $PWD\"; echo \"SCRIPT = $SCRIPT\"; while :; do RUN=\"$PWD/$SCRIPT\"; if [[ -e $RUN ]]; then echo \"Run script found at $RUN\"; \"$RUN\" \"$FILE\"; break; else echo \"No $RUN found\"; fi; [[ $PWD != \"/\" && $PWD != \"~\" ]] || { echo \"No $SCRIPT found\" && break; }; PWD=$(dirname \"$PWD\"); done'\u000D",
"text": "\u0003bash -c 'FILE=\"${file}\"; PWD=$(dirname \"$FILE\"); SCRIPT=\".vscode/run.sh\"; while :; do RUN=\"$PWD/$SCRIPT\"; if [[ -e $RUN ]]; then \"$RUN\" \"$FILE\"; break; fi; [[ $PWD != \"/\" && $PWD != \"~\" ]] || { echo \"No $SCRIPT found\" && break; }; PWD=$(dirname \"$PWD\"); done'\u000D"
}
}
]