Install Visual Studio (VS) Code on CentOS7

Install VSCode on CentOS

In this article, we review how to install VSCode on CentOS 7, providing step-by-step instructions to ensure a seamless setup of the Visual Studio Code editor on your CentOS 7 Linux system.

Table of Contents

Introduction

If you are a software developer, you have certainly heard of Visual Studio (VS) Code.  It is an open-source cross-platform editor developed by Microsoft. In this tutorial, we will review how to install VS code editor on CentOS7 or RHEL7. Some of the features included with VS code include: built-in debugging support, embedded Git control, code completion, code refactoring, snippets, syntax highlighting, and integrated terminal.

Before we begin

Ensure that you are the root user or that you have sudo administrative privileges to become root. It’s always good practice to execute commands as a non-root user with elevated sudo privileges.

Enabling VS Code Repository

The simplest way to install VS code on a linux machine (CentOS7 or RHEL7), is by enabling the VS code repository from the command-line (CLI). But, before we proceed with that, lets first import its GPG key by entering the following command:

				
					$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
				
			

Next, we need to create a file for it (below): There are many text editors we can use to accomplish this but for this tutorial, we will be using nano.

				
					$  sudo nano /etc/yum.repos.d/vscode.repo
				
			

Copy and paste the following contents (below) into the vscode.repo file. Then save and exit your text editor.

				
					[code] 
name=Visual Studio Code 
baseurl=https://packages.microsoft.com/yumrepos/vscode 
enabled=1 
gpgcheck=1 
gpgkey=https://packages.microsoft.com/keys/microsoft.asc
				
			

The VS Code Repository is now enabled.

Install VSCode on CentOS7

With the VS Code repository enabled, we can now install VS code using yum (below):

				
					$ sudo yum -y install code
				
			

You’re done! It’s that simple. Once the install is finished, you can launch it from your CentOS7 Desktop or execute the code command from the CLI.

				
					$ code
				
			
Install VSCode on CentOS

Photo by admingeek from Infotechys

Install VSCode on CentOS7: Features of VSCode

  • Cross-Platform: Visual Studio Code is a cross-platform code editor that works seamlessly on Windows, macOS, and Linux, providing a consistent development experience across different operating systems.

  • Intelligent Code Completion: VSCode offers intelligent code completion that suggests code snippets, function names, and variable names, speeding up the coding process and reducing errors.

  • Integrated Git Control: Git integration is built directly into VSCode, allowing developers to manage version control, commit changes, and resolve conflicts without leaving the editor.

  • Extensible: VSCode is highly extensible, with a vast library of extensions available in the Visual Studio Code Marketplace. These extensions enhance functionality, add language support, and provide additional tools.

  • Integrated Terminal: The editor includes an integrated terminal, allowing developers to run shell commands, scripts, and other tools directly within the VSCode interface.

  • Debugging Support: VSCode supports debugging for various programming languages, providing a unified debugging experience with features like breakpoints, watch variables, and interactive debugging.

  • Syntax Highlighting and Linting: The editor provides syntax highlighting for a wide range of programming languages and supports linting tools, helping developers catch errors and maintain code quality.

  • Customizable Themes: Users can personalize the editor’s appearance with customizable themes and color schemes, making it visually appealing and comfortable for extended coding sessions.

  • Intelligent Code Navigation: VSCode offers features like Go to Definition, Find All References, and Peek Definition, making it easy to navigate and understand complex codebases.

  • Built-in Extensions for Popular Languages: VSCode comes with built-in support for popular programming languages like JavaScript, Python, Java, and more, ensuring a smooth development experience out of the box.

Conclusion

Installing Visual Studio Code on CentOS 7 enhances the development environment for users seeking a versatile and feature-rich code editor. With our comprehensive guide, you’ve navigated the installation process, enabling you to harness the power of VSCode’s integrated development environment. Whether you’re a software developer, system administrator, or a Linux enthusiast, the accessibility and functionality of VSCode on CentOS 7 open up a world of possibilities for coding, debugging, and collaboration. 

As you explore the myriad extensions and customization options within VSCode, you’re well on your way to optimizing your development workflow on the CentOS 7 platform. Was this article helpful to you? If so, leave us a comment below. We’d love to hear from you!

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *