CODESYS collapse all folders shortcut and editor zoom

6 min read · Published November 4, 2026

Select a node in the CODESYS project tree and press Numpad / to collapse it with all subfolders; Numpad * expands it again, and the same keys fold ST blocks. On 3.5.20.10 there is no global zoom default: each editor file keeps the zoom last set on it, so set 100% on your ST and LD files and 80% on visualizations once, then save the project.

CODESYS 3.5 has no Collapse All button in the project tree, and on 3.5.20.10 it has no global zoom default either. You do not need either one to work fast. The tree already answers to the Numpad keys: select a node, press Numpad / and the node folds with every subfolder under it; press Numpad * and the whole subtree opens again. The same keys fold and unfold blocks in the ST editor. Zoom works the other way: each editor file keeps the zoom last set on it, so there is nothing to configure globally. Set the zoom you want on each file once, save the project, and every file reopens at the zoom it kept. Below are the keys, the symptoms that point at focus problems, the zoom routine, and the checks to run once at a bench.

The keys that fold the tree and ST blocks

These are the standard tree-view keys every desktop file explorer uses, and CODESYS passes them through to its trees and to the code-folding structures in the ST editor. All four act on whatever node or block you have selected.

Key What it does
Numpad / Collapses the selected node with every subfolder under it
Numpad * Expands the selected node with every subfolder under it
Numpad - Collapses only the selected element
Numpad + Expands only the selected element

Selection decides the result. Select a root such as Application and Numpad / folds the whole subtree in one press; select a child and only that child's branch folds. In the ST editor, put the cursor inside a folding region and the same keys fold or unfold that block.

Symptoms and what each points to

  • The keys do nothing in the tree. Focus is still in an editor window. Click a node in the project tree first.
  • The keys type *, /, + or - into your code. Focus is in a text editor or a rename field. Leave the field and click a tree node.
  • The main-row *, /, + and - do nothing. The tree answers to the Numpad keys, which send different key codes. A laptop without a Numpad needs a USB keypad or its embedded numeric overlay.
  • Only one folder folds. You pressed Numpad -, which acts on one element, or the node you selected is itself a child. Select the top node and use Numpad /.
  • One editor's zoom changes and the others keep theirs. That is the zoom design on this build: storage is per editor file, and there is no global default to set.

Collapse the whole tree from the keyboard

  1. Click any node in the project tree so the tree, not an editor window, holds focus.
  2. Use the arrow keys to reach the topmost node you want folded, for example Application.
  3. Press Numpad /. The node folds with every subfolder under it.
  4. Repeat on each root you want folded, usually Library next.
  5. Press Numpad * on a folded root when you want the entire subtree back.

Two presses per root is the whole job. The mouse cannot match it on a tree that has filled up over a long editing session.

Set the zoom once per editor file

On 3.5.20.10, zoom is stored per editor file. That is why your ST file holds 100% while the visualization holds 80% and neither follows the other: each document keeps the last zoom set on it, and this build adds no global default and no reset-all control for zoom. The routine that works:

  1. Open each editor file you actually edit and set the zoom with the editor's own zoom control: 100% on your ST and LD files, 80% on the visualizations.
  2. Save the project. Every file reopens at the zoom it kept, this session and the next.
  3. The first time you create a new object, check what zoom it opens at and set it if needed. This build documents no default zoom for new objects.

If you want to hunt for anything configurable anyway, editor and visualization settings live under Tools > Options and keyboard assignments live under Tools > Customize. An option absent there is a missing feature on this build, not something you have misconfigured. Re-setting zoom is editing work only; when a visualization refuses to send after a compile, that is a download fault, and Fix a WebVisu file that will not send after compile covers it. Save as soon as the zooms are where you want them, because a crash with unsaved work throws the settings away; if a crash damages the project file itself, recover a corrupt CODESYS project file after a crash walks through getting the work back.

Example: 28 clicks down to 2 keystrokes

Scenario: your tree shows Application with 4 folders and Library with 3, and each of those 7 folders holds 3 subfolders. Fully expanded that is 7 + (7 × 3) = 28 nodes with an arrow on screen: 16 under Application (4 + 12) and 12 under Library (3 + 9).

Folding by mouse is one click per visible arrow: 28 clicks every time you want the tree tidy. By keyboard it is 2 keystrokes: click Application, press Numpad /, click Library, press Numpad /. Each press folds the selected root with everything under it, 16 nodes in one case and 12 in the other. Opening both subtrees again is Numpad * on the same two roots: 2 keystrokes against 28 clicks.

The same project has 5 ST POUs, 2 LD POUs and 2 visualizations: 9 editor files to set once. Seven take 100% and two take 80%; save once, and all 9 reopen at their stored zoom from then on. The one-time cost is 9 settings, and after that zoom upkeep on this build is zero.

Check it before you rely on it

Run this sequence once, at a bench, not in the middle of commissioning:

  1. Click a top tree node, press Numpad /, and confirm every level under it folds in one press.
  2. Press Numpad * and confirm the full subtree reopens.
  3. Open an ST object, put the cursor in a folding region, press Numpad - and Numpad +, and confirm the block folds and unfolds.
  4. Set your two target zooms on one ST file and one visualization, save, close and reopen the project, and confirm both files reopen at the stored zoom.
  5. If a key stays dead, open Tools > Customize and look for a binding on that key before you blame the keyboard.

The decision on this build

Recommendation: Fold the tree with Numpad / on each root and reopen with Numpad *, two presses per root, and keep a USB keypad on the bench if your laptop has no Numpad, because the main-row keys send different key codes and will not trigger the tree. Set the zoom you want on each editor file once, save, and treat per-file zoom as the design: there is no global default, no reset-all and no Collapse All button on this build, so stop hunting through menus and put the two presses in your fingers' memory.

None of this needs hardware from us; the keys live in your engineering PC. If the cell or the corridor also needs a notice board that plays shift plans, photos and short clips from a card with no internet, we build those as shop-floor screens.

Questions

How do I collapse all folders in CODESYS on a laptop without a Numpad?

The tree answers to the Numpad keys, and the main-row *, /, + and - send different key codes, so they will not trigger it. Plug in a small USB keypad, or use the embedded numeric overlay if your laptop has one: on many keyboards the overlay sits on letter keys in small print, reached with Fn. One keypad on the bench covers every CODESYS tree and ST folding job.

Will a newer CODESYS version add a global zoom default?

This answer is for 3.5.20.10, where zoom is stored per editor file. Visualization releases add settings under Tools > Options > Visualization over time, and each version's release notes lists them. Read the release notes for your exact build before you assume the behavior changed, and keep setting zoom per file until one of them shows a global default.

Can I bind a collapse command to a different key?

Open Tools > Customize and search the command list for a collapse command you can bind to a key. If your build lists none, the Numpad keys are the only tree folding shortcut on it, and a feature request goes to the CODESYS support channel with your exact version number. If a default key ever does something unexpected, check its binding in Customize before you retrain your fingers.

Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.

Keep reading

Build your signAsk for a quote