Visual Studio Code
Installation
- https://wiki.archlinux.org/title/Visual_Studio_Code
- https://github.com/VSCodium/vscodium
- https://aur.archlinux.org/packages/vscodium-bin
paru -S vscodium-bin
Basic editing tips
Multiple cursors
To compare a file with any branch
There seems to be a built-in option in version 1.94.2:
- open
Source Control
left-hand sidebar; - select
Source Control
section; - right-click the file in
Changes
panel; - pick
Open Changes with > Open Changes with Branch or Tag
.
Themes
- Darkula IntelliJ Theme
- JetBrains Dark Theme
- GitHub Theme (nice theme that applies to file menu on the left)
- light theme (I like to use it in daylight)
- https://marketplace.visualstudio.com/items?itemName=Equinusocio.vsc-material-theme
- https://marketplace.visualstudio.com/items?itemName=akamud.vscode-theme-onelight
- https://github.com/tonsky/vscode-theme-alabaster
- https://github.com/mrworkman/papercolor-vscode-redux
- https://marketplace.visualstudio.com/items?itemName=miguelsolorio.min-theme
- https://marketplace.visualstudio.com/items?itemName=thenikso.github-plus-theme
- https://marketplace.visualstudio.com/items?itemName=dericcain.feather
- https://marketplace.visualstudio.com/items?itemName=uloco.theme-bluloco-light
- https://marketplace.visualstudio.com/items?itemName=lkytal.FlatUI
- https://marketplace.visualstudio.com/itemdetails?itemName=sdras.night-owl
Plugins:
- Java
- Mavan for java
- Project Manager for Java
- Debugger for Java
- Test Runner for Java
- Language Support for Java by Red Hat
- Go
- JavaScript and Web Development: IDE extensions for Web Development
- rust-analyzer
- haskell-linter
- Haskell Syatax Highlighting
- Open in Vim (if working with Vim is not possible)
- Vim emulation for Visual Studio Code
- Markdown preview (Eclipse markdown editor and ghostwriter are alternatives)
- GitLens - In addition to other functionality, GitLens enables the local repo to be compared with other branches in the remote repo. E.g. the local feature branch can be compared with the remote main.
- Update settings:
- To eliminate verbose (and copious) messages, turn off “Current Line Blame” “Git Code Lens” and “Hovers”
- To add GitLens icon to the left hand navigation panel, select “GITLENS LAYOUT”
- To compare local repo with any branch, select GitLens icon → SEARCH & COMPARE → Compare
- To compare a file with any branch, right click in file and select Open Changes / Open Changes with Branch or Tag…
- Jest Runner - Allows a single jest test to be run from editor
Customizations
Different theme per window
Setting a theme per workbench
https://stackoverflow.com/questions/52514491/different-theme-per-window-in-visual-studio-code
Is it possible to open 2 Visual Studio Code sessions with different themes? Maybe like this:
- Window 1: light theme → backend application
- Window 2: dark theme → frontend application
You can have a different theme per workspace/folder by adjusting the workbench.colorTheme in the workspace settings.
- Open a new VSCode window.
- Open the project folder where you would like to have a different color theme.
- Navigate to File > Preferences > Settings.
- Select the “Workspace Settings” tab at the top of the settings screen. Anything you edit in here will now be specific to this workspace.
- Search for “colorTheme” and select the color theme you would like for this specific workspace.
Using extensions
- Peacock
- It doesn’t change the color of the entire workspace but it shows a different color for the navigation bar on the left to identify different workspaces based on color. I haven’t used it extensively.
- https://marketplace.visualstudio.com/items?itemName=johnpapa.vscode-peacock
- https://github.com/johnpapa/vscode-peacock
To remove the sideview bar (called the minimap)
Set "editor.minimap.enabled": false
in your user or workspace settings.
Use the settings.json file
Copy the contents of the settings file from here and paste it in your settings file: https://github.com/explorer436/Dotfiles2/tree/main/.config/Code%20-%20OSS/User Depending on your platform, the user settings file is located here:
- Windows %APPDATA%\Code\User\settings.json
- macOS $HOME/Library/Application\ Support/Code/User/settings.json
- Linux $HOME/.config/Code/User/settings.json
How can you see the Visual Studio Code extension list?
Look here:
Windows %USERPROFILE%\.vscode\extensions
Mac ~/.vscode/extensions
Linux ~/.vscode/extensions
How to install OSS code (the open source version of Visual Studio Code) in Fedora?
RHEL, Fedora, and CentOS based distributions#
We currently ship the stable 64-bit VS Code in a yum repository, the following script will install the key and repository:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
Then update the package cache and install the package using dnf (Fedora 22 and above):
sudo dnf check-update
sudo dnf install code