5 minute read

VS Code. How I installed and configured my VSCode.

Introduction

Visual Studio Code (VS Code) is a popular source-code editor that can be used with a variety of programming languages. It is a lightweight and versatile tool that can be customized to fit your needs. Whether you are a beginner or an experienced developer, VS Code is a great option to consider for your coding projects. Since I discovered VS Code, I use it as a primary tool as a code editor that allows me to efficiently write and debug python code for my Data Science projects. To be honnest I am very satisfied about it and I hope you’ll understand why. While there are many great options out there, I personally use and recommend Visual Studio Code.

It is very important to note that VSCode is a free, open-source. It is designed to be lightweight and fast, with a wide range of features that make it ideal for a variety of programming languages and workflows. With VSCode, you can easily write and debug code, work with version control systems, and customize your editor to suit your specific needs.

As a data scientist, I find VSCode particularly valuable for several reasons. Firstly, it has built-in support for a variety of programming languages, including Python, R, and SQL. This makes it easy to switch between languages and work on multiple projects in a single editor. All of your hole project can be placed in one single editor. Even this blog was writen in VSCode by using the markdown language. Additionally, VSCode has a wide range of extensions available, I will talk about them later in this article, describing each extension that I use in my VS Code configuration. Finally, VSCode integrates seamlessly with version control systems like Git, allowing you to easily track changes to your code and collaborate with others.

Overall, as a data scientist, I find VSCode to be an indispensable tool for my work. Whether I’m writing Python scripts, analyzing data in R, or working with SQL databases, VSCode provides a fast, customizable, and powerful environment for writing and debugging code. In the rest of this blog series, I’ll be sharing some of my favorite tips and tricks for using VSCode as a data scientist.

Installing VS Code

To get started with VS Code, you first need to download and install it on your computer. The installation process is straightforward and can be completed in just a few steps.

  1. Go to the official VS Code website and click on the “Download” button.
  2. Select the appropriate download link based on your operating system (Windows, macOS, or Linux). In my case I select macOS.
  3. Run the installer file and follow the prompts to install VS Code on your computer.

Once the installation is complete, you can launch VS Code and start using it to code.

Setting Up VS Code

After you have installed VS Code, there are a few settings and extensions that you may want to configure to optimize your workflow.

Set Up User Preferences

The first thing you should do is set up your user preferences. This includes settings such as your preferred font, theme, and formatting options. To access the user settings, click on the gear icon in the bottom left corner of the VS Code window and select “Settings”.

From here, you can modify the default settings or create your own custom settings. For example, you can change the font size by adding the following line to your user settings file:

"editor.fontSize": 14

Install Extensions

VS Code has a large selection of extensions that can enhance your coding experience. These extensions can add new features, improve performance, or support specific programming languages. To install an extension, click on the “Extensions” icon on the left-hand side of the VS Code window and search for the extension you want to install.

Here are some popular extensions that I am using and to consider include if you are a developer of a data scientist:

  • GitHub Copilot This extension is an AI assistant that will sugest a line or a whole function.
  • Python: This extension provides support for Python development, including code formatting, debugging, and linting.
  • Pylance is an advanced code analysis capabilities, including intelligent code completion, type checking, and error highlighting. It also includes powerful refactoring tools, such as rename and extract variable, to help streamline your coding workflow.
  • Python Indent automatically adjusts the indentation level of your code as you type, based on the context of the code. This can save you time and reduce errors when writing Python code
  • Jupyter allows to work with Jupyter notebooks directly within the editor.
  • Jupyter Notebook Renderers allows to preview and interact with Jupyter notebooks within the editor. Supports a wide range of file formats, including .ipynb, .rmd, and .md files. You can preview the output of code cells, view interactive visualizations, and even interact with widgets directly within VSCode.
  • French Language Pack for Visual Studio Code provides French translations for the editor’s user interface and content. Menus, options, and error messages will be displayed in French, making it easier for French-speaking users to navigate and use the editor.
  • Markdown all in one makes it easier to write and format Markdown documents. It provides a wide range of features, including syntax highlighting, table formatting, and automatic link detection. It also includes useful shortcuts for creating headings, lists, and other elements, as well as preview and export options for your Markdown documents.
  • Markdown Preview Enhanced is a powerful and customizable Markdown previewer. You can preview your Markdown files with a live preview, complete with customizable themes and styles. It also includes support for advanced features, such as code highlighting, math typesetting, and diagrams.
  • Python Environment Manager extension is used to manage Python environments for your projects. It allows you to create and switch between multiple virtual environments, each with their own Python interpreter and installed packages.
  • Tabine provides intelligent suggestions for code as you type. The extension uses machine learning algorithms to analyze your code and provide relevant suggestions for variables, functions, and code snippets. It supports a wide range of programming languages, including Python
  • English Support for LanguageTool and English word hint (auto-completion) are extensions that provides English editor support.

Create a Workspace

Finally, you may want to create a workspace to organize your coding projects. A workspace is a collection of related files and folders that you can open together in VS Code. To create a new workspace, click on the “File” menu and select “New Workspace”.

From here, you can add folders to your workspace and customize the workspace settings. This can help you stay organized and improve your workflow.

Conclusion

Installing and setting up VS Code is a simple process that can greatly improve your coding experience. In addition, it is a powerful and versatile tool that can greatly improve your coding experience. By customizing your user preferences, installing extensions, and creating workspaces, you can optimize your workflow and make coding more efficient. Give it a try and see how it can benefit your development projects.

Happy coding!