Skip to the workspace
Pebellslearn by building
Setting Up  ›  Lesson

Code Editors and IDEs

Code Editors / IDEs 10 minAn editor or IDE makes writing C faster through highlighting, completion and live errors from a language server, but the compiler you installed still does the real building.

c / Code Editors and IDEs

Explore each scene at your own pace.

01 · The rule

The rule

Code Editors and IDEs

An editor or IDE makes writing C faster through highlighting, completion and live errors from a language server, but the compiler you installed still does the real building.

Separate editing assistance from the toolchain that actually builds your source.

You can write the whole greenhouse logger in a plain text editor, and plenty of experienced C programmers do. A good setup, though, shows mistakes the moment you type them, completes long names, and builds with one key. The skill is knowing which part does what.

The rule

The editor shapes the text; the compiler decides whether it is C.

The popular choices:

Tool What it is How it understands C
VS Code Free editor with extensions Microsoft's C/C++ extension, or the clangd extension
Vim / Neovim Keyboard-driven terminal editors A language server such as clangd (Neovim has an LSP client built in)
CLion Full IDE from JetBrains Built-in analysis, CMake projects
Visual Studio Full IDE on Windows MSVC and its own analysis

A language server is a background program that reads your code the way a compiler does and reports errors, warnings and completions to the editor. clangd is the common one for C, and it works the same in VS Code, Neovim and many other editors.

The language server has to know how you build. With no information it guesses, so tell it. The simplest way is a file named compile_flags.txt next to your code, one flag per line:

-std=c17
-Wall
-Wextra

Bigger projects generate a compile_commands.json from their build system instead.

None of these tools includes a compiler by magic. VS Code and Vim edit text; the GCC or Clang you installed still does the building.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.