Repository navigation
Auto formatting #1203
Auto formatting
#1203
|
Does vscode-R have some functionality that enables autoformatting of code with a shortcut? I'm imagining something similar to what was described in this post: |
Answered by
renkun-ken
Sep 23, 2022
Replies: 2 comments 4 replies
|
You could bind shortcut keys to the following in "Keyboard shortcuts": {
"key": "shift+alt+f",
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "cmd+k cmd+f",
"command": "editor.action.formatSelection",
"when": "editorHasDocumentSelectionFormattingProvider && editorTextFocus && !editorReadonly"
} |
4 replies
Answer selected by
eitsupi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could bind shortcut keys to the following in "Keyboard shortcuts":
{ "key": "shift+alt+f", "command": "editor.action.formatDocument", "when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor" }, { "key": "cmd+k cmd+f", "command": "editor.action.formatSelection", "when": "editorHasDocumentSelectionFormattingProvider && editorTextFocus && !editorReadonly" }