For the latest version of JMP Help, visit

Publication date: 11/10/2021

Add Code Folding Markers

You can add code folding markers that show the beginning and the end of the code block, enabling you to collapse and expand code inside stand-alone functions.

To turn on this feature, select Code folding in the Script Editor preferences. Then you can expand and collapse blocks of code by right-clicking on a script and selecting Advanced > Expand All or Collapse All.

Tip: To fold or expand all code in the entire script, press Shift+Ctrl and then click a code marker.

After you select this preference, Function and Expr expressions are foldable. See Add More Folding Keywords for more information about adding folding markers to other expressions.

Figure 4.7 Code Folding Markers Shown in a Script 

Code Folding Markers Shown in a Script

By default, code does not remain collapsed after you save the script and restart JMP. To save the state of the folded code, select Save and restore document state information in the Script Editor preferences.

Add More Folding Keywords

Custom code folding is supported for other stand-alone functions as shown in the following example:

{"If", "For", "For Each Row", "While", "Try", "New Window", "V List Box", "H List Box"}

JMP supports multiple keyword lists. A system administrator can define a set of keywords in jmpKeywords.jsl and save the script in C:/ProgramData/SAS/JMP/ or designated directory listed below. You save your version of jmpKeywords.jsl in your C:/Users/<user>/Documents/ folder. JMP merges all keyword lists from the designated directories.

On Windows, the following directories are examined in the order listed:






On macOS, the following directories are examined in the order listed:

/Library/Application Support/JMP/16/

/Library/Application Support/JMP/

~/Library/Application Support/JMP/16/

~/Library/Application Support/JMP/


Note that jmpKeywords.jsl is stored in the designated JMP directory, even if you are using JMP Pro.


The list in jmpKeywords.jsl is case insensitive.

Code folding is not supported for messages, platforms, user-defined functions, and comments.

After you edit and save the list in jmpKeywords.jsl, turn the Allow additional code folding keywords preference off and then back on for the changes to take effect. Messages in the log indicate that the keywords were loaded.

Want more information? Have questions? Get answers in the JMP User Community (