Agentfly

Editing

Code folding

Editing · 1 min read

Collapse a chunk of code down to one line, and open it again when you want it.

When you would want it

A file is easier to read when the parts you are not working on are out of the way.

Where to find it

  • All Features → Code folding
  • Turn on or off
  • Settings

What you get out of it

  • Long files become skimmable: fold everything except what you are working on.
  • The structure stays visible as '...' markers instead of vanishing entirely.

How to use it, step by step

  1. Hover the margin beside a function or block - the fold arrow appears.
  2. Click it to collapse the block to one line. Click again to expand.
  3. Prefer keys? Ctrl+Shift+[ folds the block at the cursor; Ctrl+Shift+] opens it.
  4. Folded state is yours alone - it never changes the file on disk.

Why this beats the usual way

Scrolling a 2,000-line file costs attention every time. Folding lets the file stay long where it needs to be and short where you are.

Find it in Universal Search

Code folding · Editing