ne Tips

Tips and Tricks for using ne—the Nice Editor

ne, the Nice Editor is a straightforward text editor with surprising capabilities for such a small program. ne Tips provides a set of short tutorials on getting the most from ne's features.

Using Bookmarks (2007.10.12)

A bookmark in ne marks a spot in a document. ne supports 10 bookmarks per open document, numbered 0 through 9. It also supports one automatic bookmark designated by a hyphen ("-"). If you don't specify which bookmark you mean with either of the two bookmark commands SetBookmark and GotoBookmark, ne will assume you mean bookmark 0. Both of these commands are available in the Search menu, or by their keyboard shortcuts Esc-k and Esc-G respectively, but they can only use bookmark 0 that way. If you want to use bookmarks 1 through 9 or "-", you have to activate the command line (^k).

To set a bookmark at the current cursor position, use the command SetBookmark [n] where n is some number between 0 and 9. It will default to 0 if you leave it out. The abbreviated name for this command is SBM.

You can easily move from anywhere in the document to an already set bookmark with the command GotoBookmark [n] or its abbreviation GBM [n].

Using the Automatic Bookmark "-"

Any time you use the GotoBookmark command, ne sets the automatic bookmark "-" to the current position at the time you entered the command. This can be handy if you go to a bookmark and want to return to the place you came from. For example, say you SetBookmark 5 at an important place in your document that you need to refer to frequently. As you edit, you realize you need to see this place, so you GMB 5. Now you've seen what you needed to see, perhaps copied part of it to the clipboard, etc., and need to return to the spot from which you jumped to bookmark 5. ne set the automatic bookmark "-" to that location, so you can activate the command line (^k) and enter GBM -. This will take you back to where you started.

Note that ne sets the automatic bookmark on every GotoBookmark command, including GBM -! So if you are anywhere in your document, then goto a bookmark, you can then bop back and forth between those two places with repeated GBM - commands. And since the command line presents your last command when you activate it, you can repeat that command by hitting ^k-Enter over and over.

Jumping to Specific Lines (2007.10.12)

The GotoLine n command, available in the Search menu or from the keyboard shortcut ^j (for "jump"), lets you easily move to any line in your document. The first line in your document is number 1, but you can use the special line number 0 to specify the last line. So the command GotoLine 0 or the equivalent shotcut key sequence ^j-0-Enter will quickly move to the end of your document even when you don't know the number of the last line.