← HW 0 overview

Introduction to VSCodium

CMSC 141 • HW 0, part 2 of 6

You will need an internet connection for this section.

The editor you write code in is one of your most-used tools. You are welcome to use whatever editor you like, but we recommend VSCodium. VSCodium is the same program as the popular VS Code, built from the same source, but with Microsoft's telemetry and aggressive code-assistance features stripped out. It is beginner-friendly, powerful once you know it, and works across many languages, so the time you spend learning it now carries over to other courses.

Installing VSCodium

Follow the steps for your operating system.

macOS

First find out whether your Mac has an Intel or an Apple (ARM) processor. Open the Apple menu, choose About This Mac, and look at the "Chip" or "Processor" line. Anything with "Intel" in it means an x86 processor; "Apple M1," "Apple M2," and so on mean an ARM processor. You need this below.

  1. Go to https://vscodium.com.
  2. Click INSTALL at the top, then Download latest release.
  3. For an Intel Mac, find the macOS row under x86 64bits and download the .dmg file (something like VSCodium.x64.<version>.dmg). For an Apple/ARM Mac, use the ARM 64bits table and the VSCodium.arm64.<version>.dmg file. Exact version numbers change over time.
  4. Double-click the downloaded .dmg, then drag the VSCodium icon onto the Applications folder.

Once the copy finishes, VSCodium is installed. You may want to add it to your dock.

Windows

Find out whether your machine has an Intel or ARM processor: open SettingsSystemAbout and read the "Processor" line. A name with "Intel" in it means x86, which is the common case.

  1. Go to https://vscodium.com.
  2. Click INSTALL, then Download latest release.
  3. For x86, find the Windows row under x86 64bits and download the User Installer (something like VSCodiumUserSetup-x64-<version>.exe). For ARM, use the corresponding User Installer in the ARM 64bits table.
  4. Double-click the .exe to run the installer. Accept the terms and the default options, and let it finish.

Linux

Install from the terminal:

$ sudo apt update && sudo apt install codium

If that does not work, ask an instructor or staff member for help.

Configuring VSCodium

A few settings will keep your code consistent with the style we use and head off some common Git headaches. The first time you open VSCodium it asks you to choose a theme; pick whatever you like and close the welcome tab.

Your settings file

Rather than flip these switches one at a time, paste them all in at once. Open the command palette with Ctrl-Shift-P (Command-Shift-P on macOS), type settings json, and choose Preferences: Open User Settings (JSON). You will see a file holding a pair of curly braces. Replace everything in it with this:

{
    // Use spaces, not tab characters, and make each indent four spaces.
    // Mixing tabs and spaces is the most common cause of Python errors.
    "editor.tabSize": 4,
    "editor.insertSpaces": true,
    "editor.detectIndentation": false,

    // Faint vertical lines at columns 80 and 120, so you can keep lines
    // from running too long. The color line just makes them blue.
    "editor.rulers": [80, 120],
    "workbench.colorCustomizations": {
        "editorRuler.foreground": "#4f6ef7"
    },

    // Draw the indentation guide lines and highlight the one your cursor
    // sits inside, so you can see which block of code you are in.
    "editor.guides.indentation": true,
    "editor.guides.highlightActiveIndentation": true,

    // Show leading spaces as faint dots, so your indentation is visible
    // and a stray tab jumps out at you.
    "editor.renderWhitespace": "boundary",

    // Optional: pin the current def/if/for line at the top as you scroll.
    // Off by default; set this to true to try it.
    "editor.stickyScroll.enabled": false,

    // Turn off the built-in Git tools for now. They help once you are
    // comfortable with Git, but tend to confuse newcomers.
    "git.enabled": false
}

Save with Ctrl-s (Command-s on macOS). The next time you open a Python file you should see four-space indents, a blue guide line at column 80, and faint dots marking the spaces at the start of each indented line.

Later, once you are comfortable with Git on your own, change "git.enabled": false to true to turn the editor's Git tools back on.

The built-in terminal

VSCodium has a terminal built in. Open it with Ctrl-Shift-`.

Adding the codium command

You can launch VSCodium from the terminal with the codium command. The Windows installer sets this up for you. On macOS you do it by hand: open the command palette with Command-Shift-P, search for install, and choose Shell Command: Install 'codium' command in PATH. A confirmation pop-up means it worked.