0.7Setting up a code editor

Last updated June 11, 2026

With Rust installed, you need somewhere to write it. Technically, any program that edits plain text will do. At the other end of the spectrum, you may have heard programmers argue about their editors with the intensity normally reserved for sports teams. This lesson is here to keep you out of both ditches.

A proper code editor gives you, at minimum: colors that make the structure of code visible (syntax highlighting), automatic indentation, and an integrated way to run your programs. The good news for Rust specifically is that the intelligent features (error squiggles that appear as you type, completion that suggests what can come next, hover-for-documentation, jump-to-definition, project-wide rename) all come from a single official brain that nearly every editor can use.

rust-analyzer, the shared brain

That brain is called rust-analyzer. It's a program (maintained within the Rust project itself) that continuously reads your code, understands it, and feeds whatever editor you're using its analysis: here's an error, here's what this function expects, here's everywhere this name is used.

Key insight

Because the intelligence lives in rust-analyzer rather than in any particular editor, your choice of editor matters much less than internet arguments suggest. Pick one, learn it reasonably well, and know that switching later costs you an afternoon, not your skills.

Our recommendation: VS Code with rust-analyzer

If you don't already have a strong editor preference, use Visual Studio Code. It's free, works the same on Windows, macOS, and Linux, and has the largest community (which means your "how do I X in my editor" searches will find answers). Setup takes about two minutes, after you've installed Rust per the previous lesson:

  1. Download VS Code from code.visualstudio.com and install it.
  2. Open it, and click the Extensions icon in the left sidebar (the four squares; or press Ctrl+Shift+X, on a Mac Cmd+Shift+X).
  3. Search for rust-analyzer and install the extension by that name. The publisher should read rust-lang: that's the Rust project itself.

That's it. The extension wakes up whenever you open a folder containing Rust code. The first time you open a project, give it a moment (there's a brief flurry of indexing in the status bar while rust-analyzer reads everything); after that, errors and suggestions appear as you type.

A solid alternative: RustRover

RustRover is a full Rust IDE from JetBrains, and it's the "everything decided for you" option: editor, project tools, debugger, and Rust support engineered as one product rather than assembled from parts. At the time of writing, it's free for non-commercial use (learning counts; you'll need a free JetBrains account) and paid for commercial work. If you've used other JetBrains tools (IntelliJ, PyCharm) and liked them, you'll feel at home. The lessons in this course are editor-agnostic, so RustRover users are fully covered.

Other editors, briefly

Zed, Sublime Text, Helix, Neovim, Emacs: all of these speak to rust-analyzer, and all of them have happy Rust users. If one of them is already home, stay. If you're a beginner, we'd gently steer you to VS Code purely because more tutorials, screenshots, and forum answers will match what's on your screen.

What about the Rust Playground?

The Rust Playground is an official website where you can type a snippet of Rust and run it in your browser, nothing installed. It has real uses: sharing a snippet when asking for help, or testing a three-line idea from a computer that isn't yours. It is not, however, a place to live. It can't hold real multi-file projects, most third-party crates aren't available, and your work isn't saved. Treat it as a notepad, not a workshop.

Setups to avoid

A few arrangements cause enough quiet misery to deserve explicit warnings:

A bare text editor with no Rust support. Notepad and TextEdit will technically work, but you'd be flying blind: no highlighting, no inline errors, no completion. You'd be giving up the exact tools that make learning faster.

A word processor. Never Word, Google Docs, or TextEdit in rich-text mode. Word processors silently "improve" your code, most notoriously by replacing the straight quotes " that code requires with curly “smart quotes” that compilers reject. Code goes in plain text files, made by plain text tools.

An online playground as your only setup. For the reasons above: fine to visit, bad to inhabit.

Best practice

While you're learning, turn off AI code completion (Copilot and friends) if your editor has it. The point of these early chapters is to build the syntax into your fingers and learn to fix your own errors. An autocomplete that writes the line for you does that practice instead of you. rust-analyzer's ordinary completion (names and methods that exist) is fine; it's the sentence-finishing kind to postpone. Once the basics are automatic, by all means invite the robots back in.

Editor installed? Then you have everything you need: toolchain, editor, and an empty afternoon. In the next lesson, you finally get to compile something.