Visual Studio Code: Difference between revisions
Jump to navigation
Jump to search
NickPGSmith (talk | contribs) |
NickPGSmith (talk | contribs) m (8 revisions imported) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
Open command pallette: | Open command pallette: | ||
* SHIFT + CTRL + | * SHIFT + CTRL + P | ||
Toggle sidebar: | |||
* CTRL + B | |||
Zoom in/out | Zoom in/out | ||
Line 32: | Line 35: | ||
* ALT + UPArrow | * ALT + UPArrow | ||
* ALT + DownArrow | * ALT + DownArrow | ||
Duplicate line: | |||
* SHIFT + Alt + Up or Dwn | |||
Delete line | |||
* SHIFT + CTRL + K | |||
Peek editor | Peek editor | ||
* SHIFT | * SHIFT + F12 | ||
Comment/uncomment: | Comment/uncomment a line: | ||
* CTRL | * CTRL + / | ||
Highlight current line: | Highlight current line: | ||
Line 92: | Line 101: | ||
* [https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance pylance] language server (includes pyright functionality) | * [https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance pylance] language server (includes pyright functionality) | ||
** Python > Analysis: Type Checking Mode: basic | ** Python > Analysis: Type Checking Mode: basic | ||
=== Remote Development Extension Pack === | |||
* Connect to SSH/WSL hosts | |||
* Command Pallette: Remote SSH: Connect current window to host | |||
== Settings == | == Settings == | ||
Line 100: | Line 114: | ||
* Files: Trim Trailing Whitespace: true | * Files: Trim Trailing Whitespace: true | ||
Vertical Rulers can be set in settings.json: | |||
"editor.rulers": [ | |||
80, 120 | |||
] | |||
=== File === | === File === |
Latest revision as of 04:53, 8 May 2024
Installation
- Download
- Fedora Requires "gtk2" package
Keyboard Shortcuts
Show shortcuts:
- CTRL + K CTRL + S
Open command pallette:
- SHIFT + CTRL + P
Toggle sidebar:
- CTRL + B
Zoom in/out
- CTRL + SHIFT +
- CTRL + SHIFT -
Top/Bottom of file:
- CTRL + Home
- CTRL + End
Save all:
- CTRL + K S
Preview MD at side
- CTRL + K V
Rename variable everywhere:
- F2
Move line up/down:
- ALT + UPArrow
- ALT + DownArrow
Duplicate line:
- SHIFT + Alt + Up or Dwn
Delete line
- SHIFT + CTRL + K
Peek editor
- SHIFT + F12
Comment/uncomment a line:
- CTRL + /
Highlight current line:
- CTRL + L
Copy a line:
- ALT + SHIFT + UpArrow
Block indent / Outdent:
- CTRL + ]
- CTRL + [
Block comment / uncomment:
- CTRL + K C
- CTRL + K U
Run code:
- CTRL + F5
Open MD preview:
- SHIFT + CTRL + v
Summary sheet here.
Extensions
PlatformIO IDE
- platformio.platformio-ide
Python
Python (Microsoft) provides IntelliSense, and installs:
- Jupyter
- Pylance
See settings:
- python.analysis.typeCheckingMode: off/basic/strict
- python.formatting.provider: autopep8
Reorder imports, add to settings.json:
"editor.codeActionsOnSave": { "source.organizeImports": true }
Or, "sortImports" to not remove unused imports.
- pylint
- Python: Enable Linting
- Python: Select Linter
- pylance language server (includes pyright functionality)
- Python > Analysis: Type Checking Mode: basic
Remote Development Extension Pack
- Connect to SSH/WSL hosts
- Command Pallette: Remote SSH: Connect current window to host
Settings
UI
File > Preferences > Settings > [User, Workspace, as required]
- Files: Trim Trailing Whitespace: true
Vertical Rulers can be set in settings.json:
"editor.rulers": [ 80, 120 ]
File
- [Workspace] > .vscode > settings.json
- ~/.vscode/extensions/[extension]/pythonFiles/.vscode/settings.json
"python.linting.enabled": true, "python.linting.pylintArgs": ["--enable=F,E,W"]
Syntax Highlighter
- Install Node.js
- npm install -g yo generator-code
yo code
- New Language Support
- Complete questions
- Copy new directory to $HOME/.vscode/extensions
- package.json : Language description
- syntaxes/tpl.tmLanguage.json : main language matching (see language grammars)
- language-configuration.json : Defines the tokens that are used for comments and brackets (see docs)
To inspect:
- Command Palette: Developer: Inspect Editor Tokens and Scopes
To package:
npm install -g vsce cd myExtension vsce package
To publish:
vsce publish