Author
Affiliations
Federal University of ViçosaIData

Getting started with VsCode

Short tutorial with basic information

QGSL Lab | Basic VS Code Tutorial

A quick guide to getting started with VS Code. Created with new team members in mind.


Content

  1. Objectives
  2. Installation Guide
  3. Workspace Concept
  4. Interface Essentials
  5. Extensions - The Heart of VS Code
  6. Writing and Executing Code
  7. Shortcuts & Hotkeys
  8. Suggested Workflow

1) Objectives

  • Get comfortable with the VS Code environment.
  • Learn to navigate the interface without getting lost.
  • Understand the basic settings for common languages (e.g.: Python/R/Notebooks).
  • Master a small set of shortcuts to enhance productivity.

2) Installation Guide

2.1) For Linux

Debian and Ubuntu-based distributions

  • Just run the command: sudo apt install ./<file>.deb if you have the .deb file.
  • Another option is to run the prompt sudo snap install code --classic to install via snap.
  • You can also use this link to download the graphical installer.

2.2) For Windows

💡 Note: For Mac, other Linux distros, and more information, you can access the official website here.


3) Projects and Workspaces in Visual Studio Code

VS Code considers a "workspace" to be the collection of one or more folders that are opened in a VS Code window. When you open a folder in VS Code, it becomes your current workspace.

It is important to mention that VS Code can be configured in a user-specific way (e.g., settings, keybindings, themes) for each workspace, giving you two levels of control:

  • User settings: Global settings for all workspaces.
  • Workspace settings: Specific to each workspace.

4) VS Code Interface Essentials

ComponentDescription
1 - Activity BarExplorer: Manage files; Search: Global search; Source Control: Git integration; Extensions: Manage plugins.
2 - Side BarDisplays the content of the selected Activity Bar item.
3 - EditorWhere you code. Tips: Alt + Z (Word wrap) and AI Autocomplete/IntelliSense.
4 - Terminal`Ctrl + `` to toggle. Supports multiple instances (Bash, Python, R, etc.).

5) Extensions - The Heart of VS Code

In VS Code, extensions transform the editor into a complete work environment. Remember: the fewer the better. Only install and activate what you're going to use.

Tip: Use Profiles to create different environments (e.g., Data Analysis vs. Web Dev) so you only load necessary extensions.

5.1 Managing extensions

  • Open the panel with: Ctrl + Shift + X
  • Install: Some may require a reload.
  • Disabling: If an extension causes issues, you can disable or uninstall it.

5.2 Recommended for Data Analysis

  • 📦 Essentials:
    • Python: IntelliSense, debugging, and environment management.
    • Jupyter: Support for .ipynb notebooks.
    • R: Install the R extension and the languageserver package in R.
  • ✨ Code Quality:
    • Prettier: Consistent code styling.
    • Error Lens: Highlights errors directly in the editor.
    • GitLens: Line-by-line history of changes.

6) Code Execution

6.1 Three ways to execute code

  1. Via Editor: Using the Play button ▶️.
  2. Via Terminal: Running commands directly in the folder. Best for large pipelines.
  3. Via Selection: Execute only selected lines (similar to Ctrl + Enter in RStudio).

6.2 Python: Interpreter and Environment

Common mistake: Using the wrong Python version. If using a venv, ensure the correct interpreter is selected.

  • Open the Command Palette (Ctrl + Shift + P) → Python: Select Interpreter.

Bonus: The Command Palette is one of the most useful features in VS Code.

6.3 Notebooks (.ipynb)

  • Open .ipynb files directly.
  • Run code cell by cell.
  • Choose the right Kernel (Python/R) when prompted.

6.4 Quick Diagnosis

  • Is the language extension installed?
  • Is the correct Interpreter/Kernel selected?
  • Are you in the right workspace (check terminal path)?
  • Are dependencies installed in your current venv?

7) Essential Hotkeys

HotkeyActionWhy it matters?
Ctrl + PQuick OpenQuickly search and open files.
Ctrl + Shift + PCommand PaletteThe easiest way to find any command.
Ctrl + DSelect Next MatchUseful for renaming variables across multiple lines.
Alt + ↑ / ↓Move Line Up/DownReorganize code without cutting and pasting.
Ctrl + /Toggle CommentInstantly comment/uncomment selected lines.

8) Recommended Workflow

  1. Open the project folder (Workspace).
  2. Enable the extensions required for your task.
  3. Select the correct interpreter or kernel.
  4. Write and execute your code.
  5. Master the common hotkeys.

Finally: VS Code is a powerful tool with multi-language support that will significantly improve your research efficiency.


By: João Paulo Gusmão Teixeira for internal use at QGSL on 08/02/2026