Running VS Code on Linux
Installation
Debian and Ubuntu based distributions
The easiest way to install for Debian/Ubuntu based distributions is to download and install the .deb package (64-bit) either through the graphical software center if it's available or through the command line with:sudo dpkg -i <file>.deb
sudo apt-get install -f # Install dependencies
Installing the .deb package will automatically install the apt
repository and signing key to enable auto-updating using the regular
system mechanism. Note that 32-bit and .tar.gz binaries are also
available on the download page.The repository and key can also be installed manually with the following script:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
Then update the package cache and install the package using:
sudo apt-get update
sudo apt-get install code # or code-insiders
Setting VS Code as the default text editor
xdg-open
You can set the default text editor for text files (text/plain
) that is used by xdg-open
with the following command:xdg-mime default code.desktop text/plain
Debian alternatives system
Debian-based distributions allow setting a default editor using the alternatives system, without concern for the mime type. You can set this by running the following and selecting code.sudo update-alternatives --set editor /usr/bin/code
For more, please comment...