NEdit.org    The Nirvana Editor Web Site
.

NEdit.org Home
Table of Contents

Getting Started

Basic Operation
Selecting Text
Finding/Replacing
Cut and Paste
Using the Mouse
Keyboard Shortcuts
Shifting and Filling
File Format

Features for
Programming

Programming
Tabs/Emul. Tabs
Auto/Smart Indent
Syntax Highlighting
Finding Decl.

Regular Expressions
Basic Syntax
Escape Sequences
Parenthetical Const.
Advanced Topics
Examples

Macro/Shell Extensions
Shell and Filters
Learn/Replay
Macro Language
Macro Subroutines
Action Routines

Customizing
Customizing NEdit
Preferences
X Resources
Key Binding
Highlighting Patterns
Indent Macros

Miscellaneous
NEdit Cmd Line
Client/Server Mode
Crash Recovery
Problems/Defects

.

 

.

Syntax Highlighting

Syntax Highlighting means using colors and fonts to help distinguish language elements in programming languages and other types of structured files. Programmers use syntax highlighting to understand code faster and better, and to spot many kinds of syntax errors more quickly.

To use syntax highlighting in NEdit, select Highlight Syntax in the Preferences menu. If NEdit recognizes the computer language that you are using, and highlighting rules (patterns) are available for that language, it will highlight your text, and maintain the highlighting, automatically, as you type.

If NEdit doesn't correctly recognize the type of the file you are editing, you can manually select a language mode from Language Modes in the Preferences menu. You can also program the method that NEdit uses to recognize language modes in Preferences -> Default Settings -> Language Modes....

If no highlighting patterns are available for the language that you want to use, you can create new patterns relatively quickly. The section below titled "Writing Syntax Highlighting Patterns", has details.

If you are satisfied with what NEdit is highlighting, but would like it to use different colors or fonts, you can change these by selecting Preferences -> Default Settings -> Syntax Highlighting -> Text Drawing Styles. Highlighting patterns are connected with font and color information through a common set of styles so that colorings defined for one language will be similar across others, and patterns within the same language which are meant to appear identical can be changed in the same place. To understand which styles are used to highlight the language you are interested in, you may need to look at "Patterns for Highlighting" section, as well.

Syntax highlighting is CPU intensive, and under some circumstances can affect NEdit's responsiveness. If you have a particularly slow system, or work with very large files, you may not want to use it all of the time. Syntax highlighting introduces two kinds of delays. The first is an initial parsing delay, proportional to the size of the file. This delay is also incurred when pasting large sections of text, filtering text through shell commands, and other circumstances involving changes to large amounts of text. The second kind of delay happens when text which has not previously been visible is scrolled in to view. Depending on your system, and the highlight patterns you are using, this may or may not be noticeable. A typing delay is also possible, but unlikely if you are only using the built-in patterns.

 

<< Previous Section
Automatic Indent
Table of Contents
Next Section >>
Finding Declarations (ctags)

 

 

. . Released on  Wed, 6 Nov 2002  by C. Denat