Editing source code
You can use structured text editors to create, modify, and validate your source code.
About this task
A structured text editor is any of several editors that you can use to edit markup languages such as cascading style sheets (CSS), DTD, HTML, JavaScript, JSP, XML, and XSD (schema).
A structured text editor provides capabilities such as find and replace, undo, redo, a spelling checker, and coding assistance. It also highlights syntax in different colors. Structured text editor capabilities include:
- syntax highlighting
- Each keyword type and syntax type is highlighted differently, enabling you to easily find a certain type of keyword for editing. For example, in HTML, element names, attribute names, attribute values, and comments have different colors; in JavaScript, function and variable names, quoted text strings, and comments have different colors.
- unlimited undo and redo
- These options enable you to incrementally undo and redo every change made to a file for the entire editing session. For text, changes are incremented one character or set of selected characters at a time.
- content assist
- Content assist helps you to insert JavaScript functions, HTML tags, or other keywords. Choices available in the content assist list are based on functions that are defined by the syntax of the language in which the file is coded.
- user-defined templates and snippets
- By using the Snippets view, you can access user-defined code snippets and (for all code types except JavaScript) templates to help you quickly add regularly used text strings.
- function selection
- Based on the location of your cursor, the function or tag selection indicator highlights the line numbers that include a function or tag in the vertical ruler on the Source page.
- pop-up menu options
- These are the same editing options available in the workbench Edit menu.
Tip: Before you search in a structured text editor, save the file
that you are searching. The search function works from the most recently saved version of the file
rather than from the contents that you see in the editor area. You do not need to save your file
before you find and replace text.