With Auto Indent turned on (the default), NEdit keeps a running indent. When you press the return key, space and tabs are inserted to line up the insert point under the start of the previous line.
The Shift Left and Shift Right commands adjust the indentation for several lines at once. To shift a block of text one character to the right, select the text, then choose Shift Right from the Edit menu. Note that the accelerator keys for these menu items are Ctrl+9 and Ctrl+0, which correspond to the right and left parenthesis on most keyboards. Remember them as adjusting the text in the direction pointed to by the parenthesis character. Holding the Shift key while selecting either Shift Left or Shift Right will shift the text by one full tab stop.
To find a particular line in a source file by line number, choose Goto Line #... from the Search menu. You can also directly select the line number text in a compiler message in the terminal emulator window (xterm, winterm, decterm, etc.) where you ran the compiler, and choose Goto Selected from the Search menu.
To find the line number of a particular line in your file, turn on Statistics Line in the Preferences menu, and position the insertion point anywhere on the line. The statistics line continuously updates the line number of the location of the insertion cursor.
To help you inspect nested parentheses, brackets, braces, quotes, and other characters, NEdit has both an automatic parenthesis matching mode, and a Find Matching command. Automatic parenthesis matching is activated when you type or move the insertion cursor after a parenthesis, bracket, or brace. It momentarily highlights the matching character if that character is visible in the window. To find a matching character anywhere in the file, select it or position the cursor after it, and choose Find Matching from the Search menu. If the character matches itself, such as a quote or slash, select the first character of the pair. NEdit will match {, (, [, <, ", ', `, /, and \.
The Open Selected command understands the C preprocessor's #include syntax, so selecting an #include line and invoking Open Selected will generally find the file referred to, unless doing so depends on the settings of compiler switches or other information not available to NEdit.
NEdit can process tags files generated using the Unix ctags command. Ctags creates index files correlating names of functions and declarations with their locations in C, Fortran, or Pascal source code files. (See the ctags manual page for more information). Ctags produces a file called "tags" which can be loaded by NEdit. Once loaded, the information in the tags file enables NEdit to go directly to the declaration of a highlighted function or data structure name with a single command. To load a tags file, select Load Tags File from the File menu and choose a tags file to load, or specify the name of the tags file on the NEdit command line:
nedit -tags tags
NEdit can also be set to load a tags file automatically when it starts up. Setting the X resource nedit.tagFile to the name of a tag file tells NEdit to look for that file at startup time (see Customizing NEdit). The file name can be either a complete path name, in which case NEdit will always load the same tags file, or a file name without a path or with a relative path, in which case NEdit will load it starting from the current directory. The second option allows you to have different tags files for different projects, each automatically loaded depending on the directory you're in when you start NEdit. Setting the name to "tags" is an obvious choice since this is the name that ctags uses.
To find the definition of a function or data structure once a tags file is loaded, select the name anywhere it appears in your program (see Selecting, Cutting, and Pasting Text) and choose Find Definition from the Search menu.
Select a topic for more information.
Return to the Software page.
Return to ACS home page.
Please send comments and suggestions to
consult@rpi.edu