OpenSCAD User Manual/Using an external Editor with OpenSCAD

OpenSCAD session using emacs as an external editor

Why use an external editor

edit

Many people prefer to use a certain editor. They are used to the feature set and know the keybindings. OpenSCADs editor is functional and simple but might lack features people know from other editors.

A relatively recent benefit is that many of the more powerful external editors can act as a client for an OpenSCAD language server, permitting IDE-style functionality such as inline error/warning displays, module/function documentation on hover, jump to module/function definition, find module/function references, code reformatting, etc. There are a handful of OpenSCAD language servers in various levels of development, currently the openscad-lsp language server provides the most features.

How to use an external editor

edit

OpenSCAD is able to check for changes of files and automatically recompile if a file change occurs. To use this feature enable "Design->Automatic Reload and Preview"

Once the feature is activated, just load the scad file within OpenSCAD as usual ("File->Open.."). After that, open the scad file in your favorite editor too. Edit and work on the scad file within the external editor. Whenever the file is saved to disk (from within the external editor), OpenSCAD recognizes the file change and automatically recompiles accordingly.

The internal editor can be hidden by minimizing the frame with the mouse or by selecting "View->Hide editor".

Support of external editors

edit

In principle all editors can be used. Some even have extensions/modes to provide features for OpenSCAD.