Visual Studio Code
Sort Lines
Sort lines - Visual Studio Marketplace https://marketplace.visualstudio.com/items?itemName=Tyriar.sort-lines
Shortcut key: F9
Upper Case
In Visual Studio it was:
To convert text to all upper case, choose Edit > Advanced > Make Uppercase or press Ctrl+Shift+U. To convert text to all lower case, choose Edit > Advanced > Make Lowercase or press Ctrl+U.
Make Uppercase or press Ctrl+Shift+U Make Lowercase or press Ctrl+U
So, to mimmic, set the following Keyboard Shortcuts:
- Transform to Uppercase -> editor.action.transformToUppercase -> Ctrl+Shift+U
- Transform to Uppercase -> editor.action.transformToUppercase -> Ctrl+U
They conflict with existing shortcuts, but doesn't appear to cause any problems...
Chocolatey Install
choco install vscode
https://update.code.visualstudio.com/1.94.0/win32-x64/stable
End of Line Character
Settings -> "files: Eol" and change from "auto" to "\n".
.
Can switch live using the setting in the "status bar":
WSL
code --remote wsl+Ubuntu /home/jim/projects/c
ref: [1]
Code Folding
Collapse Code Blocks
- Fold All: Ctrl+K Ctrl+0 (Windows/Linux) or Cmd+K Cmd+0 (macOS) collapses all foldable regions.
- Unfold All: Ctrl+K Ctrl+J (Windows/Linux) or Cmd+K Cmd+J (macOS) expands all collapsed regions.
- Fold Current Block: Ctrl+Shift+[ (Windows/Linux) or Cmd+Shift+[ (macOS) folds the innermost uncollapsed region at the cursor.
- Unfold Current Block: Ctrl+Shift+] (Windows/Linux) or Cmd+Shift+] (macOS) unfolds the collapsed region at the cursor.
Expand to 2nd level:
- First expand all:
- Ctrl+K Ctrl+J
- Second expand
- Ctrl+K Ctrl+2
List Plugins and Versions
List VS Code extensions and Versions:
code --list-extensions --show-versions
Glassworm Malware Returns
Glassworm malware returns in third wave of malicious VS Code packages https://www.bleepingcomputer.com/news/security/glassworm-malware-returns-in-third-wave-of-malicious-vs-code-packages/
Settings Files
Open the command pallet and type ">" then "settings" to see the 3 options for:
- Preferences: Open Workspace Settings (JSON) - [projectpath]\ .vscode\settings.json
- Preferences: Open Default Settings (JSON) - \defaultSettings.jsonc
- Preferences: Open User Settings (JSON) - %APPDATA%\Code\User\settings.json
New Windows Maximized
To make VS Code open maximized by default, you need to adjust two settings in the Settings UI or your settings.json file.
Configure Settings
- Open Settings: Open the VS Code Settings UI by pressing Ctrl+, (Windows/Linux) or Cmd+, (Mac).
- Search for newWindowDimensions: In the search bar, type "newWindowDimensions".
- Set the Value: In the dropdown menu for the Window: New Window Dimensions setting, select maximized. This ensures that new windows open in a maximized state.
- Search for restoreFullscreen: Next, search for "restoreFullscreen".
- Enable the Setting: Check the box for the Window: Restore Fullscreen setting. This makes VS Code remember its last state, including being maximized, when it is closed and reopened.
- Restart VS Code: Close all VS Code windows and reopen the application. It should now open maximized by default.
Alternatively, you can add these lines to your settings.json file (accessible via the command palette with Preferences: Open Settings (JSON) (ctrl-p, ">", "open user settings.json")
"window.newWindowDimensions": "maximized", "window.restoreFullscreen": true