Visual Studio Code – Linux Hint https://linuxhint.com Exploring and Master Linux Ecosystem Mon, 01 Mar 2021 00:17:42 +0000 en-US hourly 1 https://wordpress.org/?v=5.6.2 How to Install and Use Visual Studio Code on Linux Mint 20 https://linuxhint.com/install-visual-studio-code-linux-mint/ Wed, 24 Feb 2021 16:17:25 +0000 https://linuxhint.com/?p=91359

Developed by Microsoft, Visual Studio (VS) Code is a multi-platform, modern, and comprehensive code editor. The Visual Studio Code supports TypeScript, Node.JS, JavaScript by default. Moreover, a plethora of extensions are available for visual studio code, enabling us to support other programming languages like C, C++, GO, etc. The Visual Studio Code is available as a Debian package, flatpak package, and snap application.

Installing Visual Studio Code on Linux Mint 20 from the Debian package

To download the VS Code official Debian package, open your browser and visit the VS Code webpage (https://code.visualstudio.com/Download).

The VS code Debian package, is available for Linux. Click on the Debian package to download it.

Next, choose ‘Save File’ and click on ‘OK’.

The VS, code Debian package, will be downloaded in the ‘Downloads’ directory.

Once the Debian package is downloaded, fire up the terminal and navigate to the ‘Downloads’ directory with the command:

$ cd Downloads

Next, update the apt cache because it is recommended to update the apt cache before installing any new application:

$ sudo apt update

Type the below-given command to install the VS code .deb package:

$ sudo apt install ./code_1.52.1-1608136922_amd64.deb

When the VS code is successfully installed, verify the installation and check the installed version using the command:

$ code --version

The VS code 1.52.1 is successfully installed on my Linux Mint 20.

Installing Visual Studio Code on Linux Mint 20 from the snap application manager

Snap is the universal package manager for various Linux distribution. However, it is disabled on Linux Mint 20 by default. To install VS Code from the snap application manager, we need to enable and install the snapd on Linux Mint 20.

Before installing snap on Linux Mint 20, remove the nosnap.pref file with the command:

$ sudo rm /etc/apt/preferences.d/nosnap.pref

Next, update the apt cache and install the snapd with the commands:

$ sudo apt update

$ sudo apt install snapd

To install VS Code from the snap application manager, execute the command:

$ sudo snap install code --classic

Verify the installation using the command:

$ snap info code

Installing Visual Studio Code flatpak package on Linux Mint 20

Flatpak is also a package manager for Linux. It comes pre-installed on Linux Mint 20.

Fire up the terminal and update the apt cache before installing the Visual Studio Code flatpak package:

$ sudo apt update

Now, install the Visual Studio Code flatpak package with the command:

$ sudo flatpak install flathub com.visualstudio.code

The Visual Studio Code flatpak package is successfully installed.


Press ‘y’ to continue installing the Visual Studio Code flatpak package.

Getting started with Visual Studio Code

Once you have installed the Visual Studio Code application using any of the described methods, click on the Application Menu and search for Visual Studio Code.

Open the Visual Studio Code application, and a dashboard screen will appear. The default theme of Visual Studio Code is dark, but it can be changed as well.

To change the theme, click on File, choose preferences and select ‘Color Theme’.

Select the theme for the given list of themes.

The theme will be updated successfully.

To create a new file, press ctrl+n and start using Visual Studio Code.

Conclusion

Visual Studio Code is a free and popular code editor. It is a multi-platform tool installed on Linux Mint 20 through the Debian package, flatpak, and snap application manager. It provides a wide variety of extensions that enable us to use famous programming languages. This post explains the Visual Studio Code installation on Linux Mint 20.

]]>
How to Install Visual Studio Code Editor on ArchLinux https://linuxhint.com/install_visual_studio_code_archlinux/ Mon, 09 Nov 2020 03:10:44 +0000 https://linuxhint.com/?p=76208 Visual Studio Code is free, open-source, incredibly robust, and one of the most acclaimed source-code editors out there. Developers around the world use Visual Studio Code to edit code for a variety of programming languages, most notably, Javascript, Java, and C++. Visual Studio Code is available for Linux, as well as more commercial operating systems, such as Windows and macOS. The software also comes with multiple extensions for file transfer protocol, which allows it to be used for web development.

A developers survey conducted in 2019 places Visual Studio Code at #1, with well over 50% of respondents voting in favor. This level of popularity speaks to the utility of this extremely versatile coding editor.

This tutorial will show you how to install Visual Studio Code on ArchLinux using Snaps.

Step 1: Install Snap

Snap is available in the Arch User Repository, so we will be downloading it from there.

Enter the following code to install snap on your system:

$ git clone https://aur.archlinux.org/snapd.git

$ cd snapd

$ makepkg -si

Step 2: Enable Snap

Once you install Snap, you will need to activate systemd, which overlooks the main communication socket, before proceeding to install Visual Studio Code.

$ sudo systemctl enable --now snapd.socket


Then, link the /var/lib/snapd/snap directory with /snap by entering the following:

$ sudo ln -s /var/lib/snapd/snap /snap

Step 3: Install Visual Studio Code from the AUR

To download the installer package, enter the command below:

$ curl -L -O https://aur.archlinux.org/cgit/aur.git/snapshot/visual-studio-code-bin.tar.gz


Then, to unzip the build files, enter:

$ tar -xvf visual-studio-code-bin.tar.gz


Switch to the extracted package directory by issuing the following code:

$ cd visual-studio-code-bin


Finally, enter the following to install Visual Studio Code:

$ makepkg -si

Conclusion

This tutorial showed you how to install Visual Studio Code onto your Archlinux system with a snap package. Snap is a software packaging system that works across several Linux distributions and it allows users to obtain software packages onto their system.

That is all we have for you today. Stick around at linuxhint.com for more tutorials like this, and happy coding!

]]>
Install and Use VS Code in Ubuntu 20.04 https://linuxhint.com/install_use_vs_code_ubuntu/ Sat, 05 Sep 2020 11:22:54 +0000 https://linuxhint.com/?p=67525 The text editor is an integral part of the Linux experience. It does not matter whether you are working on a server or a home computer, you are guaranteed to need to edit text at some point. A suitable text editor can transform your editing experience to become more enjoyable and efficient.

This guide shows you how to install and use the VS (Visual Studio) Code text editor in Ubuntu 20.04.

VS Code in Ubuntu

VS Code is a powerful, open-source text editor developed by Microsoft. It is a GUI tool that is available for Windows, Linux, and macOS.

Why use VS Code, might you ask? VS Code comes with a number of built-in features; for example, syntax highlighting, code completion, debugging, code refactoring, Git control, integrated terminal, and others. The functionality of VS Code can be extended by implementing thousands of add-ons available from the Visual Studio Code Marketplace.

VS Code is a GUI tool for editing and managing text files. Looking for a suitable text editor in CLI? Then check out the Vim basics tutorial. This tutorial provides a simple guide for getting started with Vim, one of the finest text editors of the world.

For Ubuntu, there are multiple options available when it comes to installing VS Code. This article will show all the available methods for installing this program. Follow the method that you see fit.

VS Code DEB package

This is the standard method for installing VS Code. The text editor is officially available as a DEB package for Debian/Ubuntu and related distros.

First, grab the VS Code DEB package from the official download page.

Then, install the DEB package using the APT cache.

$ sudo apt install ./code_1.47.3-1595520028_amd64.deb

VS Code snap Package

Snaps are universal Linux packages that can be installed on any distro, given the support of snap service for that platform. A snap package is a self-contained package that includes all the binaries, along with the necessary dependencies, to run the program. Because of their versatile nature, snaps are beneficial to both developers and users.

The VS Code snap package is officially distributed and maintained by Microsoft. In the case of Ubuntu 20.04, the snap service comes pre-installed. If you do not have it installed for some reason, you can quickly install it now.

First, update the APT cache and install snap.

$ sudo apt update && sudo apt install snapd -y

Now, install the VS Code snap.

$ sudo snap install code --classic

If it is the first time that you are installing a snap package, then you will need to restart the snap service to make things work. Otherwise, ignore this step.

$ sudo systemctl restart snapd

VS Code flatpak Package

Flatpak is a similar technology to snap. They both share similar goals: easier building and distributing apps on Linux. Flatpak is simply another type of universal Linux package. As long as you have the flatpak package manager configured, you can install and run any flatpak package.

In the case of Ubuntu 20.04, unlike snap, flatpak does not come pre-installed. If you already have flatpak installed, then you can immediately proceed to the section for installing the VS Code flatpak. If not, then continue to follow along.

Fire up a terminal, update the APT cache, and install flatpak.

$ sudo apt update && sudo apt install flatpak -y

The following step is optional. It is to install the flatpak plugin for the GNOME Software app. If you are using the GNOME desktop, then it is recommended to add this plugin, which makes it possible to install flatpak apps without using the terminal.

$ sudo apt install gnome-software-plugin-flatpak

Add the FlatHub repository. FlatHub works as the official flatpak app store.

$ sudo flatpak remote-add --if-not-exists flathub
https://flathub.org/repo/flathub.flatpakrepo

Finally, install the VS Code flatpak. Check out the VS Code flatpak at FlatHub here.

$ sudo flatpak install flathub com.visualstudio.code

Using VS Code

Once the installation is complete, the editor is ready to launch.

After launching for the first time, VS Code will show you the welcome page. The editor is now good to go.

To make changes to how the editor behaves, check out the VS Code ‘Settings’ section.

To manage extensions, click the ‘Extensions’ shortcut button. Alternatively, press Ctrl + Shift + X.

This is what working with VS Code looks like. This example is a sample XML document provided by Microsoft.

Final Thoughts

VS Code is a useful text editor. It offers great value for everyone, especially for programmers. If properly configured with the right extensions and options, VS Code can also act as the perfect IDE. However, that path may require you to invest some time properly configuring the editor.

The installation methods described here are also applicable for other Debian/Ubuntu-based distros, for example, Linux Mint, Zorin OS, etc.

Enjoy!

]]>
Installing Visual Studio Code on Debian 10 https://linuxhint.com/install_visual_studio_code_debian_10/ Wed, 14 Aug 2019 14:12:41 +0000 https://linuxhint.com/?p=45256 Visual Studio Code is a great programming text editor. It is beautiful and lightweight. It is loved by many programmers all over the world.

Visual Studio Code has support for many programming languages and Git integration by default. You can also install extensions to extend the functionality of Visual Studio Code.

Visual Studio Code also has many color themes and icon themes which you can use to customize it and make it look just the way you like.

In this article, I am going to show you how to install and use Visual Studio Code on Debian 10 Buster. Let’s get started.

Downloading Visual Studio Code:

Visual Studio Code is not available in the official package repository of Debian 10. But, you can easily install it from the official website of Visual Studio Code. Just visit the official website of Visual Studio Code from your favorite web browser and click on the click as marked in the screenshot below.

Your browser should prompt you to save the DEB package file of Visual Studio Code. Just select Save File and click on OK.

Your browser should start downloading the DEB package file of Visual Studio Code. It may take a while to complete the download.

Installing Visual Studio Code:

Once the download is complete, navigate to the ~/Downloads directory with the following command.

$ cd ~/Downloads

You should find the DEB package file of Visual Studio Code here as you can see in the screenshot below.

$ ls -lh

Now, to install the Visual Studio Code DEB package file, run the APT command as follows.

$ sudo apt install ./code*.deb

The APT package manager should start installing the DEB package file.

At this point, Visual Studio Code should be installed.

Now, check whether Visual Studio Code is installed correctly with the following command.

$ code --version

As you can see, I am running Visual Studio Code 1.36.1. This is the latest version of Visual Studio Code at the time of this writing. When you install Visual Studio Code, you may have a different version.

Now, you can find Visual Studio Code in the Application Menu of your Debian 10 OS. Click on the Visual Studio Code icon.

Visual Studio Code should be opened.

Opening a New Project:

To open a new project with Visual Studio Code, go to File > Open Folder… or Press <Ctrl> + K followed by <Ctrl> + O.

Now, select a folder/directory from the file browser and click on OK.

The project folder/directory should be opened. The files in the project folder/directory should be listed as well.

To open a file from the project directory, just click on the file from the list on the left side and the file should be opened as you can see in the screenshot below.

To close the project, go to File > Close Folder. You can also use the shortcut <Ctrl> + K followed by F.

The project should be closed.

Opening a New Project from the Command Line:

You can also open a project folder/directory from the command line.

Let’s say, your project folder/directory is ~/hello-node. To open it as a project in Visual Studio Code from the command line, run the following command.

$ code ~/hello-node

The folder/directory should be opened in Visual Studio Code as you can see in the screenshot below.

Search & Replace with Visual Studio Code:

To search for specific string or search and replace codes in your project, go to the Search tab. To search, just type in the search term in the Search textbox and press <Enter>. Here, as you can see I searched for the term Hello, and the file and the line that contains the search term is displayed.

You can also click on one of the marked icons to do case sensitive search (), word search () and regular expression search ().

To replace a something, type in a search string and then type in a replacement string and click on the replace icon as marked in the screenshot below.

Now, click on Replace.

The search string should be replaced with the replace string.

Installing Extensions:

Visual Studio Code has a lot of extensions in the repository which you can download and install depending on your need to extend the functionalities of Visual Studio Code.

To search for new extensions and install them, go to the Extensions tab as marked in the screenshot below. Visual Studio Code recommends some extensions depending on the projects you’ve already opened. Visual Studio Code also lists the most popular extensions (sorted by the most number of installs) from which you can look for your required extensions.

You can also search for an extension. Type in the search term in the search text box and press <Enter>. The matched extensions should be listed as you can see in the screenshot below.

If you like an extension and want to know more about it, then click on the extension. More information about it will be displayed on the right side. If you like the extension, then click on the Install button as marked in the screenshot to install the extension.

The extension should be installed. The same way you can search and uninstall already installed extensions.

Changing Color Schemes:

Visual Studio code has some wonderful color themes preinstalled. But, you can also install some color theme extensions to get new color themes. Rainglow is a great color theme extension which I’ve installed earlier.

To change the color theme, go to Settings > Color Theme.

All the installed color themes should be listed. Select a color theme from the list to activate it.

As you can see, I’ve changed the color theme to Turnip (rainglow) and it looks nice.

So, that’s how you install Visual Studio Code on Debian 10 and use it. Thanks for reading this article.

]]>
Install Visual Studio Code on Ubuntu https://linuxhint.com/install_visual_studio_code_ubuntu/ Sat, 03 Nov 2018 08:46:14 +0000 https://linuxhint-com.zk153f8d-liquidwebsites.com/?p=31858 A code editor is one of the most important tools a developer has to keep in hand all the time. There are tons of available code editors on the internet. Visual Studio Code is an open-source code editor from Microsoft with tons of advanced and powerful features. Visual Studio Code is a lightweight yet extremely powerful source code editor. It’s available on all the major platforms – Windows, macOS, and Linux. By default, the editor comes up with support for JavaScript, Noje.js, and TypeScript. There are a number of available extensions to enable support for other popular programming languages like C++, C#, Python, Java, PHP, Go etc. Are you thinking to start programming, or looking for an advanced code editor? Let’s get started with Visual Studio Code!

Installing Visual Studio Code

The app is very simple to install. For Ubuntu platform, it’s even easier to enjoy Visual Studio Code.

  • DEB package

Get the latest DEB package of Visual Studio Code.

After the download is complete, run the following commands in a terminal –

sudo dpkg -i code_1.28.2-1539735992_amd64.deb
sudo apt install -f

  • Snap package

Visual Studio Code is also available as a snap package. Check out Visual Studio Code on Snapcraft store.

Run the following command in a terminal –

sudo snap install vscode --classic

Using Visual Studio Code

Once the installation is complete, it’s time to code with Visual Studio Code!

Here’s a demo code from HTML5 Test Page on GitHub.

The interface is dark with charming code highlighting.

Do you need additional extensions? Go to File >> Preferences >> Extensions or press the shortcut “Ctrl + Shift + X”.

For example, here’s the C/C++ extension. Simply click the “Install” button.

Voila! The extension is installed!

Need to change the view? Don’t worry! Visual Studio Code comes up with a number of available color themes. Go to File >> Preferences >> Color Theme or use the shortcut “Ctrl + K + T”.

Enjoy your coding with Visual Studio Code!

]]>
Install Visual Studio Code Arch Linux https://linuxhint.com/install_visual_studio_code_arch_linux/ Mon, 14 May 2018 07:50:09 +0000 https://linuxhint-com.zk153f8d-liquidwebsites.com/?p=26295 Visual Studio Code is a great programming text editor. It is beautiful and lightweight. It is loved by many programmers all over the world. I also love Visual Studio Code. In this article, I will show you how to install and use Visual Studio Code on Arch Linux. Let’s get started.

Installing Visual Studio Code

Visual Studio Code has installer for debian (.deb) and rpm (.rpm) based Linux distributions. Officially, no such installer is available for Arch Linux. You can download a .tar.gz file from the official website of Visual Studio Code at https://code.visualstudio.com/ and use it on any Linux distribution though. But it won’t integrate well with the system.

Gladly, Visual Studio Code is available in the Arch User Repository (AUR). This is what I will do in this article.

First update the pacman package repository cache with the following command:

$ sudo pacman -Sy

The pacman package repository cache should be updated.

Now you have to install Git version control system. It is required to install packages from AUR and also for Visual Studio Code.

Run the following command to install Git:

$ sudo pacman -S git

Press y and then press <Enter> to continue.

Git should be installed.

Now navigate to the ~/Downloads directory with the following command:

$ cd ~/Downloads

Now clone the Visual Studio Code’s AUR repository with the following command:

$ git clone https://AUR.archlinux.org/visual-studio-code-bin.git

The AUR repository of Visual Studio Code should be cloned.

Now navigate to the visual-studio-code-bin/ directory with the following command:

$ cd visual-studio-code-bin/

Now run the following command to make a pacman package of Visual Studio Code:

$ makepkg -s

Now press y and then press <Enter> to continue.

makepkg should download the .tar.gz archive of Visual Studio Code from its official website and convert it to a pacman package file (.pkg). It should take a while depending on your internet connection.

The pacman package should be created at this point.

Now run the following command to install the generated pacman package with pacman package manager:

$ sudo pacman -U visual-studio-code-bin-*.pkg.tar.xz

Now press y and then press <Enter> to continue.

The installation should be complete at this point.

Now you can remove the downloaded files and clean up your ~/Downloads directory with the following command:

$ cd ../ && sudo rm -rfv visual-studio-code-bin/

Starting Visual Studio Code

Now you can go to the Application Menu and look for Visual Studio Code there. You should see the Visual Studio Code icon as marked in the screenshot below. Click on it.

Visual Studio Code should start as you can see in the screenshot below.

Using Visual Studio Code

You can open a single file or a project directory on Visual Studio Code.

Opening a Single File:

To open a single file, you click on File > Open File… as marked in the screenshot below. You can also use the keyboard shortcut <Ctrl> + o.

Then select a file and click on Open as marked in the screenshot below.

It should be opened.

Opening a Project Directory:

To open a project directory, click on File > Open Folder… as marked in the screenshot below.

Now select a project directory and click on Open as marked in the screenshot below.

The project directory should be opened. All the files and directories inside your project directory should be listed as marked in the screenshot below.

You can click on any file from the list to open it on the Code editor as you can see in the screenshot below.

You can click on either the yellow marked icon or orange marked icon to create a file or a folder respectively.

Once you click on any of these icons, you should see a blank text box as marked in the screenshot below. Just type in a file or directory name depending on the icon you clicked and press <Enter>.

It should be created as you can see in the screenshot below.

Enable Auto Save:

You can click on File > Auto Save to enable Auto Save. If you enable Auto Save, all the files that you changed using Visual Studio Code will be saved once the Visual Studio Code loses focus (that is you clicked on some other window than Visual Studio Code).

Changing Themes:

On Visual Studio Code, you can change the File Icon Theme and Color Theme. To change themes, click on the gear icon as marked in the screenshot below.

Select either Color Theme or File Icon Theme from the menu.

Now select any one of the Color Theme from the list as marked in the screenshot below.

It should be applied.

Installing Extensions

Visual Studio Code has many extensions. Click on the gear icon and click on Manage Extensions.

Then search and install any extension you want.

That’s how you install and use Visual Studio Code on Arch Linux. Thanks for reading this article.

]]>
Visual Studio Code 1.14 Now Ships with TypeScript 2.4 https://linuxhint.com/install-microsoft-visual-studio-code-editor-linux/ https://linuxhint.com/install-microsoft-visual-studio-code-editor-linux/#respond Thu, 13 Jul 2017 19:04:29 +0000 http://sysads.co.uk/?p=16851 Microsoft Visual Studio Code 1.14 recently released, is an open-source code editor every developer needs for their core edit, build, and debug cycle. Visual Studio Code provides comprehensive editing and debugging support, an extensibility model, and lightweight integration with existing tools.

This latest release comes with a numerous new features, various bug fixes as well as improvement. A notable feature is multiple projects can be opened in the same editor for Insiders build. It also ships with TypeScript 2.4.1.

Before we proceed on how to install Microsoft Visual Studio Code on Ubuntu, lets take a quick look at its features.

install Microsoft Visual Studio Code

Visual Studio Code Features

  • IntelliSense – A very helpful syntax highlighter and autocomplete feature that provides smart completions based on variable types, function definitions, and imported modules
  • Debugging – The built in debugger helps you accelerate editing, compiling, and debugging by adding breakpoints and watchers. By default it comes with support for NodeJS and can debug anything that is transpiled to JavaScript
  • Built-in Git – There is a built in GUI for Git for the most common commands which makes it really easy to instantly see the changes you’re making in your project
  • Integrated terminal with ability to handle multiple instances.
  • Customizable via extensions and themes.
  • Icons – VS Code offers icon theming so that you can switch between icon themes in the same manner you’d switch code themes.

Visual Studio Code 1.14 Changelog

  • Integrated Terminal improvements:  Integrated Terminal has been completely re-worked from a regular web selection model to one managed as well as rendered by the terminal itself
  • Command Palette MRU list: You can now quickly find and re-run last typed or recently used commands
  • New Tasks menu:  Task menu now added to the top-level menu bar
  • Automatic indentation: You can now auto indent while typing, moving, as well as pasting source code
  • Emmet abbreviation enhancements: Added Emmet to any language, with Multi-cursor support
  • New Diff review pane: Navigate Diff editor changes quickly with F7, hence displayed in patch format
  • Angular debugging recipe: new recipe added to help debug your Angular client in VS Code
  • Better screen reader support: Aria properties added to better present list as well as drop-down items
  • Preview: 64 bit Windows build: Try out the Windows 64 bit version (Insiders build)

See release notes for full details

How to install Visual Studio Code 1.14 on Ubuntu 17.04, Ubuntu 16.10, Ubuntu 16.04, Ubuntu 15.04, Ubuntu 14.04

32bit

sudo apt-get install gdebi

wget https://az764295.vo.msecnd.net/stable/b8cd5b9556d8b70ea560d35b903422363f6c5c40/code_1.14.0-1499721425_i386.deb

sudo gdebi code_1.14.0-1499721425_i386.deb

64bit

sudo apt-get install gdebi

wget https://az764295.vo.msecnd.net/stable/b8cd5b9556d8b70ea560d35b903422363f6c5c40/code_1.14.0-1499719149_amd64.deb

sudo gdebi code_1.14.0-1499719149_amd64.deb

How to install Microsoft Visual Studio Code 1.13 on Fedora 22 and above

32bit

wget https://az764295.vo.msecnd.net/stable/b8cd5b9556d8b70ea560d35b903422363f6c5c40/code-1.14.0-1499721578.el7.i386.rpm

sudo dnf install code-1.14.0-1499721578.el7.i386.rpm

64bit

wget https://az764295.vo.msecnd.net/stable/b8cd5b9556d8b70ea560d35b903422363f6c5c40/code-1.14.0-1499719299.el7.x86_64.rpm

sudo dnf install code-1.14.0-1499719299.el7.x86_64.rpm
]]>
https://linuxhint.com/install-microsoft-visual-studio-code-editor-linux/feed/ 0