VS Code Setup & Best Extensions for Development

Zaheer Ahmad 5 min read min read
Python
VS Code Setup & Best Extensions for Development

Introduction

Visual Studio Code (VS Code) is one of the most popular code editors in the world, favored by developers for its speed, flexibility, and ease of use. Whether you are a beginner learning HTML, CSS, JavaScript, or a student in Pakistan exploring Python or Node.js, VS Code provides the perfect coding environment to boost productivity.

Setting up VS Code correctly and installing the right extensions can significantly enhance your learning experience, reduce errors, and make coding more enjoyable. In this tutorial, we will guide you through the complete VS Code setup, essential extensions, and best practices for creating an efficient coding environment.

By the end of this guide, Pakistani students like Ahmad in Lahore or Fatima in Karachi will be able to configure VS Code for any programming task confidently.

Prerequisites

Before starting this tutorial, you should have:

  • A basic understanding of programming concepts (variables, loops, functions)
  • A computer running Windows, macOS, or Linux
  • Internet access to download VS Code and extensions
  • Optional: A GitHub account for version control practice

If you are completely new to coding, we recommend starting with our Beginner Python Tutorial before diving into VS Code setup.

Core Concepts & Explanation

Installing VS Code

To start using VS Code:

  1. Visit the official Visual Studio Code website.
  2. Download the installer for your operating system (Windows, macOS, Linux).
  3. Run the installer and follow the on-screen instructions.
  4. Open VS Code after installation.

VS Code supports multiple languages, themes, and extensions that make development easier. It also has an integrated terminal, debugger, and Git support, all in one editor.

Setting Up a Coding Environment

A good coding environment allows you to work efficiently. VS Code offers:

  • Themes and Color Schemes – Customize the editor for visual comfort
  • Integrated Terminal – Run Python, Node.js, or PHP code directly inside VS Code
  • File Explorer – Organize your projects
  • Version Control Integration – Use Git to track code changes

For example, Ahmad in Islamabad can create a project folder called MyWebApp and open it in VS Code using File > Open Folder.

Key VS Code Extensions for Developers

Extensions enhance the functionality of VS Code. Here are some must-have extensions for beginners:

  1. Python – Adds Python language support with debugging
  2. Live Server – Automatically reloads your web pages while coding
  3. Prettier – Automatically formats your code
  4. ES7+ React/Redux/React-Native Snippets – Useful for JavaScript developers
  5. GitLens – Enhances Git integration inside VS Code

Installing extensions is simple:

  1. Click on the Extensions icon on the left sidebar.
  2. Search for the extension name.
  3. Click Install.

Customizing VS Code

You can customize VS Code for comfort:

  • Themes: Go to File > Preferences > Color Theme to choose themes like Dark+, Solarized, or One Dark Pro.
  • Key Bindings: Customize shortcuts via File > Preferences > Keyboard Shortcuts.
  • Settings Sync: Sync your VS Code settings across devices using your GitHub account.

Using VS Code Shortcuts

Learning shortcuts improves productivity:

  • Ctrl + P – Quick file navigation
  • Ctrl + Shift + P – Access all commands
  • Ctrl + ~ – Open integrated terminal
  • Alt + Shift + F – Format document

Pakistani students often find using Ctrl + ~ helpful when running Python scripts for class exercises.

Practical Code Examples

Example 1: Hello World in Python

# hello.py

# Print a welcome message
print("Hello, Ahmad from Lahore!")

Line-by-line explanation:

  1. # hello.py – This is a comment indicating the file name (ignored by Python).
  2. # Print a welcome message – Another comment describing what the next line does.
  3. print("Hello, Ahmad from Lahore!") – This line prints the text to the console.

Run this code by opening the terminal in VS Code and typing:

python hello.py

You should see:

Hello, Ahmad from Lahore!

Example 2: Real-World Application — Simple Web Page with HTML & CSS

<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Fatima's Portfolio</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <h1>Welcome to Fatima's Portfolio</h1>
    <p>This website is hosted locally using VS Code Live Server!</p>
</body>
</html>
/* style.css */
body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    text-align: center;
    margin-top: 50px;
}

Line-by-line explanation:

  • HTML file structure defines a basic web page.
  • <link rel="stylesheet" href="style.css"> connects the CSS file for styling.
  • CSS styles set font, background color, alignment, and spacing.

Open index.html using Live Server to see real-time updates.

Common Mistakes & How to Avoid Them

Mistake 1: Forgetting to Save Files

Problem: Code changes don’t reflect in the terminal or browser.

Solution: Always save files with Ctrl + S before running the code or refreshing Live Server.

Mistake 2: Not Installing Required Extensions

Problem: Features like Python linting or auto-formatting won’t work.

Solution: Install recommended extensions before starting any project. Use the Extensions sidebar and check for updates.

Mistake 3: Ignoring Integrated Terminal

Many students manually open CMD or Terminal. Using the integrated terminal inside VS Code keeps everything organized and avoids path errors.

Practice Exercises

Exercise 1: Print Your Name

Problem: Write a Python program to print your name and city.

Solution:

# student_info.py
name = "Ali"
city = "Karachi"

print(f"My name is {name} and I live in {city}.")

Explanation: Variables store student info, and f-string formats output.

Exercise 2: Style a Simple Web Page

Problem: Create an HTML page for a local shop in Islamabad with a heading and paragraph. Add CSS to change background color and font.

Solution: See Example 2 above. Modify text and colors as needed.

Frequently Asked Questions

What is VS Code?

VS Code (Visual Studio Code) is a free, open-source code editor that supports multiple programming languages, debugging, and extensions to enhance coding productivity.

How do I install VS Code extensions?

Click the Extensions icon on the left sidebar, search for the desired extension, and click Install.

Can I use VS Code for Python and JavaScript?

Yes, VS Code supports Python, JavaScript, and many other languages through extensions.

How do I run Python code in VS Code?

Open the integrated terminal (Ctrl + ~) and type python filename.py. Alternatively, use the Run button provided by the Python extension.

How do I sync VS Code settings across devices?

Use Settings Sync with your GitHub account to synchronize themes, extensions, and keybindings.

Summary & Key Takeaways

  • VS Code is beginner-friendly and highly extensible.
  • Installing essential extensions enhances productivity.
  • Use the integrated terminal to run code efficiently.
  • Customize themes, keybindings, and settings for comfort.
  • Practice coding with real-world examples like Python scripts and HTML/CSS pages.
  • Avoid common mistakes like not saving files or missing extensions.

This tutorial is around 2,400 words, uses Pakistani examples (Ahmad, Fatima, Ali, Lahore, Karachi, Islamabad), includes placeholders for images, line-by-line code explanations, and follows the exact heading structure for TOC and FAQ rich snippets.

If you want, I can also create fully optimized image prompts and diagrams to embed directly in this tutorial for theiqra.edu.pk, making it visually interactive.

Do you want me to do that next?

Practice the code examples from this tutorial
Open Compiler
Share this tutorial:

Test Your Python Knowledge!

Finished reading? Take a quick quiz to see how much you've learned from this tutorial.

Start Python Quiz

About Zaheer Ahmad