Skip to content

Latest commit

 

History

History
190 lines (150 loc) · 6.97 KB

File metadata and controls

190 lines (150 loc) · 6.97 KB

VSCode Setup

Table of Contents

1. Overview

Visual Studio Code (VSCode) is a lightweight but powerful source code editor that runs on your desktop. It comes with built-in support for JavaScript, TypeScript, and Node.js and has a rich ecosystem of extensions for other languages and runtimes, including C/C++, Python, and more. VSCode is an ideal development environment for various projects due to its flexibility, extensibility, and integrated tools.

2. Installation

2.1 System Requirements

Before installing VSCode, ensure your system meets the following requirements:

  • Windows 10/11, macOS 10.15+, or Linux
  • 1.6 GHz or faster processor
  • 1 GB of RAM
  • 200 MB of disk space

For detailed system requirements, refer to the official documentation: System Requirements

2.2 Download and Install

To install VSCode on your system:

  1. Visit the official VSCode website: https://code.visualstudio.com/
  2. Download the appropriate installer for your operating system
  3. Run the installer and follow the on-screen instructions
  4. For Windows users, ensure you select the option to "Add to PATH" during installation

For detailed installation instructions for each operating system, refer to: Installation Guide

2.3 First Launch

When you first launch VSCode:

  1. You'll be greeted with a welcome page
  2. Take a moment to explore the interface
  3. The Activity Bar on the left provides access to different views
  4. The Status Bar at the bottom shows useful information about your workspace

3. Configuration

3.1 Settings

VSCode's settings can be customized to match your preferences:

  1. Access settings by pressing Ctrl+, (Windows/Linux) or Cmd+, (macOS)
  2. Settings are stored in JSON format
  3. You can configure editor behavior, appearance, and language-specific settings

For more information on configuring settings, see: Settings Guide

3.2 Extensions

Extensions enhance VSCode's functionality:

  1. Access the Extensions view by clicking the Extensions icon in the Activity Bar or pressing Ctrl+Shift+X
  2. Search for extensions by name or category
  3. Click "Install" to add an extension to VSCode

Recommended extensions for development:

  • C/C++
  • Python
  • Java
  • JavaScript and TypeScript
  • Debugger extensions
  • Git integration
  • Live Share for collaboration

3.3 Themes and Customization

Personalize your VSCode environment:

  1. Change themes via the Color Theme picker (Ctrl+K Ctrl+T)
  2. Customize the layout by dragging and repositioning panels
  3. Configure keyboard shortcuts to match your workflow (Ctrl+K Ctrl+S)

3.4 Configure SSH

Set up SSH for remote development and Git operations:

  1. Generate SSH Keys (if you don't already have them):

    • Open a terminal/command prompt
    • Run ssh-keygen -t ed25519 -C "your_email@example.com"
    • Press Enter to accept the default file location
    • Enter a secure passphrase (recommended) or leave empty
  2. Add SSH Key to SSH Agent:

    • For Windows:
      # Start the SSH agent
      eval "$(ssh-agent -s)"
      # Add your key
      ssh-add ~/.ssh/id_ed25519
      
    • For macOS:
      # Start the SSH agent
      eval "$(ssh-agent -s)"
      # Add your key
      ssh-add -K ~/.ssh/id_ed25519
      
    • For Linux:
      # Start the SSH agent
      eval "$(ssh-agent -s)"
      # Add your key
      ssh-add ~/.ssh/id_ed25519
      
  3. Configure VSCode for SSH:

    • Install the "Remote - SSH" extension from the Extensions marketplace
    • Click on the Remote Explorer icon in the Activity Bar
    • Click on "+" to add a new SSH target
    • Enter ssh user@hostname and press Enter
    • Select the SSH configuration file to update
    • Connect to your SSH target by clicking on it in the Remote Explorer
  4. Using SSH with Git:

    • Add your SSH public key to your Git provider (GitHub, GitLab, etc.)
    • Copy your public key: cat ~/.ssh/id_ed25519.pub
    • Paste it into your Git provider's SSH key settings
    • Test your connection: ssh -T git@github.com (for GitHub)
  5. Troubleshooting SSH Connections:

    • Verify SSH agent is running: ssh-add -l
    • Check SSH configuration: cat ~/.ssh/config
    • Test connection with verbose output: ssh -vT git@github.com
    • Ensure proper permissions: chmod 600 ~/.ssh/id_ed25519

For more information on SSH configuration, refer to: VSCode Remote Development over SSH

4. Development Setup

4.1 Language Extensions

To develop projects in VSCode:

  1. Install the appropriate language extensions from the Extensions marketplace
  2. Configure the extensions with any necessary paths or settings
  3. Set up your project preferences

For detailed setup instructions, refer to: Extension Marketplace

4.2 Configuring for Your Project

To configure VSCode for your development needs:

  1. Install any required language support or framework packages
  2. In VSCode, configure appropriate settings for your project type
  3. Set up any additional libraries or tools required for your project

4.3 Building and Running Code

To build and run code in VSCode:

  1. Open your project in VSCode
  2. Use the appropriate extension commands or tasks to build your code
  3. Monitor the output panel for compilation status
  4. Use the integrated terminal or debugger to run and test your code

5. Troubleshooting

Common issues and their solutions:

  • Extensions not working: Ensure compatibility and proper configuration
  • Compilation errors: Check syntax and dependency issues
  • Debugging failures: Verify launch configuration settings
  • Performance issues: Try disabling unused extensions or increasing available memory

For more troubleshooting help, visit: VSCode Troubleshooting

6. Additional Resources

Further learning and reference materials: