Last active
April 10, 2024 16:40
-
-
Save luiarthur/7ff47a9a0d213146a6f68bef460c7bfb to your computer and use it in GitHub Desktop.
VSCode map `ctrl-j` to send line down
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your key bindings in this file to override the defaults | |
[ | |
{ | |
"key": "ctrl+shift+h", | |
"command": "workbench.action.navigateLeft" | |
}, | |
{ | |
"key": "ctrl+shift+l", | |
"command": "workbench.action.navigateRight" | |
}, | |
{ | |
"key": "ctrl+shift+k", | |
"command": "workbench.action.navigateUp" | |
}, | |
{ | |
"key": "ctrl+shift+j", | |
"command": "workbench.action.navigateDown" | |
}, | |
{ | |
"key": "ctrl+j", | |
"command": "runCommands", | |
"args": { | |
"commands": [ | |
"workbench.action.terminal.runSelectedText", | |
"cursorDown", | |
] | |
}, | |
"when": "editorTextFocus" | |
}, | |
{ | |
// Source current python script. | |
"key": "ctrl+h", | |
"command": "workbench.action.terminal.sendSequence", | |
"args": { "text": "exec(open('${file}').read())\u000D" }, | |
"when": "editorTextFocus && editorLangId == 'python'" | |
}, | |
{ | |
// Source current julia script. | |
"key": "ctrl+h", | |
"command": "workbench.action.terminal.sendSequence", | |
"args": { "text": "include(\"${file}\")\u000D" }, | |
"when": "editorTextFocus && editorLangId == 'julia'" | |
}, | |
{ | |
// Source current R script. | |
"key": "ctrl+h", | |
"command": "workbench.action.terminal.sendSequence", | |
"args": { "text": "source(\"${file}\")\u000D" }, | |
"when": "editorTextFocus && editorLangId == 'r'" | |
}, | |
{ | |
"key": "ctrl+shift+enter", | |
"command": "notebook.cell.executeCellAndBelow", | |
"when": "notebookCellListFocused || editorTextFocus && inputFocus && notebookEditorFocused" | |
}, | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place in settings.json. Do this from the vs code GUI. | |
{ | |
"editor.minimap.enabled": false, | |
"editor.cursorStyle": "block", | |
"terminal.integrated.commandsToSkipShell": [ | |
"language-julia.interrupt" | |
], | |
"julia.symbolCacheDownload": true, | |
"julia.enableTelemetry": false, | |
"remote.SSH.configFile": "/Users/alui/.ssh/vscode-config", | |
"quarto.mathjax.theme": "dark", | |
"files.associations": { | |
"*.rmd": "markdown" | |
}, | |
"vim.cursorStylePerMode.insert": "line", | |
"editor.fontSize": 16 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Custom keybindings
Add the first script to
keybindings.json
, which can be accessed by:VSCode Menu -> Code -> Keyboard Shortcuts -> Open Keyboard Shortcuts (JSON) in top right corner
Resources:
Custom settings
Similarly,
settings.json
can be accessed byVSCode Menu -> Code -> Settings -> Open Settings (JSON) in top right corner