Visual Studio Code: Difference between revisions

From Omnia
Jump to navigation Jump to search
 
Line 113: Line 113:
* Dev Containers - Open any folder or repository inside a Docker container and take advantage of Visual Studio Code's full feature set.
* Dev Containers - Open any folder or repository inside a Docker container and take advantage of Visual Studio Code's full feature set.
* Docker - Makes it easy to create, manage, and debug containerized applications.
* Docker - Makes it easy to create, manage, and debug containerized applications.
* Flake8 - Linting support for Python files using Pylint.
* GitHub Copilot Chat - AI chat features powered by Copilot
* GitHub Copilot Chat - AI chat features powered by Copilot
* Hex Editor - Allows viewing and editing files in a hex editor
* Hex Editor - Allows viewing and editing files in a hex editor
* Kubernetes - Develop, deploy and debug Kubernetes applications
* Kubernetes - Develop, deploy and debug Kubernetes applications
* Makefile Tools - Provide makefile support in VS Code: C/C++ IntelliSense, build, debug/run.
* Makefile Tools - Provide makefile support in VS Code: C/C++ IntelliSense, build, debug/run.
* Mono Debug - Visual Studio Code debugger extension for Mono
* .NET Extension Pack - The ultimate collection of extensions for working with .NET in VS Code!
* .NET Install Tool - This extension installs and manages different versions of the .NET SDK and Runtime.
* PowerShell - Develop PowerShell modules, commands and scripts in Visual Studio Code!
* PowerShell - Develop PowerShell modules, commands and scripts in Visual Studio Code!
* Pylance - A performant, feature-rich language server for Python in VS Code
* Pylance - A performant, feature-rich language server for Python in VS Code
* Pylint - Linting support for Python files using Pylint.
* Python - Python language support with extension access points for IntelliSense (Pylance), Debugging (Python Debugger), linting, formatting, refactoring, unit tests, and more.
* Python - Python language support with extension access points for IntelliSense (Pylance), Debugging (Python Debugger), linting, formatting, refactoring, unit tests, and more.
* Python Debugger - Python Debugger extension using debugpy.
* Python Debugger - Python Debugger extension using debugpy.
Line 128: Line 133:
* Remote Repositories - Remotely browse and edit git repositories
* Remote Repositories - Remotely browse and edit git repositories
* Remote Tunnels - Connect to a remote machine through a Tunnel
* Remote Tunnels - Connect to a remote machine through a Tunnel
* Serial Monitor - Send and receive text from serial ports.
* WSL - Open any folder in the Windows Subsystem for Linux (WSL) and take advantage of Visual Studio Code's full feature set.
* WSL - Open any folder in the Windows Subsystem for Linux (WSL) and take advantage of Visual Studio Code's full feature set.



Latest revision as of 21:26, 9 March 2026

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".

q8zR8Vp.png

.

Can switch live using the setting in the "status bar":

uPREQTr.png

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

  1. Open Settings: Open the VS Code Settings UI by pressing Ctrl+, (Windows/Linux) or Cmd+, (Mac).
  2. Search for newWindowDimensions: In the search bar, type "newWindowDimensions".
  3. 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.
  4. Search for restoreFullscreen: Next, search for "restoreFullscreen".
  5. 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.
  6. 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

Approved Extensions

CodeScene:

  • CodeScene - Integrates CodeScene analysis into VS Code. Keeps your code clean and maintainable.

GitKraken:

  • GitLens - Git supercharged - Supercharge Git within VS Code — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more

Microsoft:

  • autopep8 - Formatting support for Python files using the autopep8 formatter.
  • C/C++ - C/C++ IntelliSense, debugging, and code browsing.
  • C/C++ DevTools - Enhanced development tools for C++ in VS Code
  • C/C++ Extension Pack - Popular extensions for C++ development in Visual Studio Code.
  • C/C++ Themes - UI Themes for C/C++ extension.
  • C# - Base language support for C#
  • C# Dev Kit - Official C# extension from Microsoft
  • Container Tools - Makes it easy to create, manage, and debug containerized applications.
  • CMake Tools - Extended CMake support in Visual Studio Code
  • Dev Containers - Open any folder or repository inside a Docker container and take advantage of Visual Studio Code's full feature set.
  • Docker - Makes it easy to create, manage, and debug containerized applications.
  • Flake8 - Linting support for Python files using Pylint.
  • GitHub Copilot Chat - AI chat features powered by Copilot
  • Hex Editor - Allows viewing and editing files in a hex editor
  • Kubernetes - Develop, deploy and debug Kubernetes applications
  • Makefile Tools - Provide makefile support in VS Code: C/C++ IntelliSense, build, debug/run.
  • Mono Debug - Visual Studio Code debugger extension for Mono
  • .NET Extension Pack - The ultimate collection of extensions for working with .NET in VS Code!
  • .NET Install Tool - This extension installs and manages different versions of the .NET SDK and Runtime.
  • PowerShell - Develop PowerShell modules, commands and scripts in Visual Studio Code!
  • Pylance - A performant, feature-rich language server for Python in VS Code
  • Pylint - Linting support for Python files using Pylint.
  • Python - Python language support with extension access points for IntelliSense (Pylance), Debugging (Python Debugger), linting, formatting, refactoring, unit tests, and more.
  • Python Debugger - Python Debugger extension using debugpy.
  • Python Environments - Provides a unified python environment experience
  • Remote - SSH - Open any folder on a remote machine using SSH and take advantage of VS Code's full feature set.
  • Remote - SSH; Editing configuration Files - Edit SSH configuration files
  • Remote Development - An extension pack that lets you open any folder in a container, on a remote machine, or in WSL and take advantage of VS Code's full feature set.
  • Remote Explorer - View remote machines for SSH and Tunnels.
  • Remote Repositories - Remotely browse and edit git repositories
  • Remote Tunnels - Connect to a remote machine through a Tunnel
  • Serial Monitor - Send and receive text from serial ports.
  • WSL - Open any folder in the Windows Subsystem for Linux (WSL) and take advantage of Visual Studio Code's full feature set.

Red Hat:

  • Ansible - Ansible language support
  • YAML - YAML Language Support by Red Hat, with built-in Kubernetes syntax support

Unknown - ukoloff:

  • win-ca - "Make Trusted Root Certificates @Windows available to VSCode extensions"

keywords