Photo by Laraib from learner lagoon |
This article offers a guide on installing VSCode on CentOS 7. We provide clear, step-by-step directions to help you set up the Visual Studio Code editor smoothly on your CentOS 7 Linux system.
Introduction
For software developers, Visual Studio (VS) Code is likely a familiar name. This open-source, cross-platform editor was created by Microsoft. In this guide, we will explain how to set up the VS Code editor on CentOS7 or RHEL7. VS Code offers several features such as built-in debugging, embedded Git control, code completion, code refactoring, snippets, syntax highlighting, and an integrated terminal.
Before We Start
Make sure you are logged in as the root user or have sudo privileges to gain root access. It's advisable to run commands as a non-root user who has elevated permissions via sudo.
Setting Up the VS Code Repository
To install VS Code on a Linux system like CentOS7 or RHEL7, the easiest method is to enable the VS Code repository using the command-line interface (CLI). However, before we do that, let’s import the GPG key with the following command:
$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
Next, we must make a file for this purpose (as shown below). Although there are several text editors available, we will use nano for this tutorial.
$ sudo nano /etc/yum.repos.d/vscode.repo
Please insert the provided content into the vscode.repo file. After that, make sure to save your changes and close the 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 repository for VS Code is now active.
To install VSCode on CentOS7
you can use the enabled VS Code repository with the yum command, as shown below:
$ sudo yum -y install code
All finished! It’s really that easy. After the installation is complete, you can either start it from your CentOS7 Desktop or run the code command using the CLI.
$ code
Photo by Laraib from learner lagoon |
Installing VSCode on CentOS 7: Features of VSCode
- Cross-Platform: Visual Studio Code functions as a code editor that is compatible with Windows, macOS, and Linux, ensuring developers enjoy a similar experience across various platforms.
- Smart Code Suggestions: VSCode provides smart code suggestions that help by offering snippets, function names, and variable names, which accelerates the coding workflow and minimizes mistakes.
- Built-In Git Management: The Git capabilities are included right in VSCode, making it easier for developers to handle version control, commit changes, and sort out conflicts without needing to exit the editor.
- Highly Customizable: VSCode can be extensively customized, featuring a wide range of add-ons in the Visual Studio Code Marketplace. These add-ons improve features, add support for different languages, and introduce new tools.
- Embedded Terminal: This editor contains an embedded terminal, letting developers execute shell commands, scripts, and other utilities right from the VSCode environment.
- Debugging Features: VSCode enables debugging for multiple programming languages, providing a streamlined debugging process that includes breakpoints, variable tracking, and interactive debugging options.
- Code Formatting and Linting: The editor highlights syntax for various programming languages and includes linting tools, which assist developers in catching mistakes and maintaining high code quality.
- Adjustable Themes: Users can modify the appearance of the editor using adjustable themes and color schemes, making it visually appealing and comfortable for long coding sessions.
- Smart Code Browsing: VSCode features tools like Go to Definition, Find All References, and Peek Definition, making it easier to explore and comprehend complicated code structures.
- Integrated Support for Well-Known Languages: VSCode supports many popular programming languages like JavaScript, Python, and Java right out of the box, ensuring a user-friendly development experience.
Conclusion:
By installing Visual Studio Code on CentOS 7, users can elevate their programming environment, as it serves as an adaptable and feature-rich code editor. This detailed guide has walked you through the setup, allowing you to tap into VSCode’s integrated development capabilities. Whether you are a software developer, system administrator, or a Linux hobbyist, VSCode’s accessibility and features on CentOS 7 provide numerous opportunities for coding, debugging, and teamwork.
As you delve into the numerous extensions and customization features available in VSCode, you’re enhancing your development experience on the CentOS 7 system. Did you find this article useful? If yes, please share your thoughts in the comments below. We would love to hear your feedback!