Arquivo JSON de configurações
Para atualizar seu settings.json
, abra a paleta de comandos comCMD+SHIFT+P
e selecione "Preferences: Open Settings (JSON)"
para editar o JSON
arquivo onde suas configurações são mantidas. Você pode copiar / colar todo o bloco de JSON
abaixo ou apenas linhas individuais.
Nota: Esses arquivos de configurações foram gerados automaticamente do meu código VS
instalação usando a extensão Settings Sync de Shan Khan.
settings.json (Configurações do usuário, em oposição às configurações específicas da área de trabalho / projeto)
{
"window.zoomLevel": 1,
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"files.associations": {},
"files.autoSave": "off",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/.history/**": true,
"**/History_**": true
},
"workbench.colorTheme": "textmate",
"workbench.editor.enablePreview": false,
"workbench.startupEditor": "welcomePageInEmptyWorkbench",
"terminal.integrated.fontSize": 14,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.copyOnSelection": true,
"terminal.integrated.confirmOnExit": false,
"editor.largeFileOptimizations": false,
"editor.suggest.shareSuggestSelections": true,
"editor.suggestSelection": "first",
"editor.minimap.enabled": false,
"editor.foldingStrategy": "indentation",
"editor.showFoldingControls": "always",
"editor.rulers": [
80
],
"editor.formatOnSave": true,
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--ignore=E203, E266, E501, W503",
"--max-line-length=79",
"--select=B,C,E,F,W,T4,B9",
"--max-complexity=18"
],
"python.formatting.provider": "autopep8",
"python.formatting.autopep8Args": [
"--ignore=E501,E402"
],
"sonarlint.rules": {
"python:S3776": {
"level": "off"
}
},
"python.languageServer": "Microsoft",
"python.dataScience.askForKernelRestart": false,
"python.dataScience.runStartupCommands": "%load_ext autoreload\n%autoreload 2",
"python.dataScience.sendSelectionToInteractiveWindow": true,
"python.dataScience.useNotebookEditor": false,
"git.autofetch": true,
"git.confirmSync": false,
"gitlens.views.repositories.location": "gitlens",
"gitlens.views.repositories.files.layout": "list",
"gitlens.views.fileHistory.location": "gitlens",
"gitlens.views.lineHistory.enabled": false,
"gitlens.views.compare.location": "gitlens",
"gitlens.views.search.location": "gitlens",
"gitlens.mode.statusBar.enabled": true,
"gitlens.mode.statusBar.alignment": "left",
"gitlens.currentLine.enabled": false,
"gitlens.hovers.enabled": false,
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"tabnine.experimentalAutoImports": true,
"indentRainbow.errorColor": "rgba(255,255,255,0.0)",
"todo-tree.tree.flat": true,
"todo-tree.highlights.defaultHighlight": {
"type": "text-and-comment",
"foreground": "grey"
},
"better-comments.tags": [
{
"tag": "?",
"color": "#8f5785",
"strikethrough": false,
"backgroundColor": "transparent"
}
{
"tag": "*",
"color": "#69a800",
"strikethrough": false,
"backgroundColor": "transparent"
}
],
"bracket-pair-colorizer-2.colors": [
"#992e24",
"#ffb997",
"#263859"
],
"cSpell.userWords": [
"YYYYMMDD",
"groupby",
"idxmax",
"inplace",
"itertools",
"multindex",
"rfind",
"strptime"
]
}
Atalhos de teclado Arquivo JSON
A atualização do arquivo JSON dos atalhos de teclado é semelhante à edição settings.json
.
Abra a paleta de comandos com CMD+SHIFT+P
e selecione "Preferences: Open Keyboard Shortcuts (JSON)"
para editar o arquivo JSON onde suas configurações são mantidas.
Você pode copiar / colar todo o bloco de JSON abaixo ou apenas linhas individuais.
Além de definir o atalho do teclado CMD+ENTER
para executar linhas no
Janela interativa Eu configurei alguns outros dois atalhos de teclado para funcionar exatamente
como o RStudio. Por exemplo, limpando o console e reiniciando a sessão R:
CRTL+L
– “Clear Console” (no RStudio) => Limpar células (na janela interativa do Python)CMD+SHIFT+F10
– “Reiniciar R” (no RStudio) => Reiniciar o Kernel (na janela interativa do Python)
Claro que existem outros atalhos que você pode configurar como o bloco de R
comando comment (Code -> Comment/Uncomment Lines
) (CMD + SHIFT + C). Basta definir
o comando VS Code "editor.action.commentLine"
para esse atalho.
Outro exemplo é o comando de R (Code -> Reflow Comment
), que envolve o código
80 caracteres usando CMD+SHIFT+/
. O VS Code pode fazer o mesmo após a instalação
a extensão chamada “rewrap” e depois dando seu comando"rewrap.rewrapComment"
o mesmo atalho de teclado. Depende realmente de você
configure os atalhos que você usa com mais freqüência.
keybindings.json
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "cmd+enter",
"command": "python.datascience.execSelectionInteractive",
"when": "editorTextFocus && python.datascience.featureenabled && python.datascience.ownsSelection && !findInputFocussed && !notebookEditorFocused && !replaceInputFocussed && editorLangId == 'python'"
},
{
"key": "shift+enter",
"command": "-python.datascience.execSelectionInteractive",
"when": "editorTextFocus && python.datascience.featureenabled && python.datascience.ownsSelection && !findInputFocussed && !notebookEditorFocused && !replaceInputFocussed && editorLangId == 'python'"
},
{
"key": "cmd+enter",
"command": "python.datascience.runcurrentcell",
"when": "editorTextFocus && python.datascience.featureenabled && python.datascience.hascodecells && !editorHasSelection && !notebookEditorFocused"
},
{
"key": "ctrl+enter",
"command": "-python.datascience.runcurrentcell",
"when": "editorTextFocus && python.datascience.featureenabled && python.datascience.hascodecells && !editorHasSelection && !notebookEditorFocused"
},
{
"key": "cmd+enter",
"command": "notebook.cell.executeAndSelectBelow",
"when": "notebookEditorFocused && activeEditor == 'workbench.editor.notebook'"
},
{
"key": "shift+enter",
"command": "-notebook.cell.executeAndSelectBelow",
"when": "notebookEditorFocused && activeEditor == 'workbench.editor.notebook'"
},
{
"key": "ctrl+l",
"command": "python.datascience.removeallcells",
"when": "python.datascience.featureenabled && !terminalFocus"
},
{
"key": "ctrl+l",
"command": "workbench.action.terminal.clear",
"when": "terminalFocus"
},
{
"key": "cmd+shift+f10",
"command": "python.datascience.restartkernel"
},
{
"key": "cmd+shift+c",
"command": "editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "cmd+/",
"command": "-editor.action.commentLine",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "cmd+i",
"command": "python.datascience.showhistorypane"
},
{
"key": "ctrl+shift+/",
"command": "rewrap.rewrapComment",
"when": "editorTextFocus"
},
{
"key": "alt+q",
"command": "-rewrap.rewrapComment",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+s",
"command": "extension.updateSettings"
},
{
"key": "shift+alt+u",
"command": "-extension.updateSettings"
}
]