Reindent Text in Vim

Reindent text with = using a motion, or fix the current line with ==. Vim applies its indentation rules for you.

Commands you practise

={motion}
Instantly fix messy code indentation. Type == to align the current line, or combine = with a motion like =ip to clean up whole blocks.
==
Instantly fix the indentation of the current line. No more manual spacing—let Vim align your code perfectly with a double tap.

Levels

  1. Single Line Sync (easy): Fix the indentation of the inner statements one line at a time.
  2. The Great Equalizer (medium): Reindent the entire flattened function in one go.
  3. Loop de Loop (hard): Use the matching bracket motion to reindent only the inner loop block.

Each level opens a real Neovim session in your browser with a start file and a target file. Edit one into the other in as few keystrokes as you can, then race the vimbot's solution.

Part of VimGolf.ai Premium ($10 once, lifetime). Region: Tidying Commands. See the whole skill map.