Stata’s Do-file Editor has been written to make programming tasks simpler than ever.
Among the features are
Syntax highlighting. Having command names, variables names, macro names, strings, operators, and other program elements in different colors allows you to spot syntax errors and bugs.
Syntax highlight user-defined keywords. Stata's command names are syntax highlighted and now you can define your own keywords such as user-written commands to syntax highlight in their own color and font style.
Current word and selection highlighting. Stata can highlight all occurrences of the current word under the cursor and separately highlight all occurrences of the current selection. The highlighting of word matches is case-sensitive, while the highlighting of selection matches is case-insensitive. There are also preferences that can prevent words in comments or strings from being highlighted, as well as preventing the highlighting of functions, keywords, or macros. You can also disable the highlighting of matches words or selections entirely.
Code folding. Code folding. Collapse code within program, mata, input, forvalues, quietly, if/else, and other blocks of code. Focus on the code you are currently writing or debugging and hide everything else. You can also select the Fold all menu item to quickly fold all foldable lines of code.
Notice that once the code is folded, an arrow pointing to the right appears next to the folded code. You can click on the arrow to unfold one block. Or you can select the Unfold all menu item to unfold all to unfold all folded block.
Column-mode. Optionally select and edit columns of text.
Indentation guide. Display vertical lines at every tab stop to aid in writing visually clean code.
Display of whitespace. In the Do-file Editor, you can choose to display whitespace characters as dots for spaces and arrows for tabs by selecting View > Do-file Editor > Show whitespace. If you find it too visually distracting to always display whitespace characters, there is a preference that allows you to see it only when you select text.
Convert extended ASCII to Unicode. Specify character encoding of legacy do-files so that any extended ASCII characters can be converted to the right Unicode character.
Automatic backups. Documents that are open in the Do-file Editor are periodically saved to a backup file on disk and unsaved changes can be recovered in case of a power outage or computer crash.
Line bookmarks. Attach a bookmark to a line of code, and then quickly access that line later by using its bookmark. Permanent bookmarks are saved with do-files. Also, temporary bookmarks can be added to easily navigate the do-file without making changes to the content of the do-file.
Navigator Panel. Navigate massive do-files seamlessly. Display a list of permanent bookmarks and programs in a do-file, and then select an item from the list to go directly to its line. You can also select multiple bookmarks and indent or delete them, or keep the Navigator hidden.
Autocompletion. Display a list of existing words in the current file as well as Stata commands to auto-complete as you type. Stata will also display a list of variable names from the current working dataset, macros, and stored results.
Autocompletion is customized. Enable or disable autocompletion of variable names, macros, and stored results. Enable or disable autocompletion while typing comments and strings.
Python, Markdown, Java, and XML support. Syntax highlighting support for Python, Markdown, Java, and XML files.
Indentation. Use spaces or tabs for indentation and convert between the two methods of indentation.
Templates. Save time and ensure consistency when creating a new document by using a template as a starting point. Use a Stata template or create and use one of your own.
Color themes (Windows and Mac). Includes support for dark mode as well as the ability to modify the color for all text and GUI elements in the editor.
Bracket highlighting. Manage complex, large blocks of code more easily as Stata highlights the brackets surrounding the code your cursor is in. Automatically insert matching characters for quotes and brackets as you type.
Add/remove comments. Make a selection and add or remove comments (/*, */ and //).
Re-indent. Make a selection and re-indent your code to be properly aligned and spaces are converted to tabs.
Tabbed windows. Open multiple files at the same time in different tabbed windows.