2.7 More Advanced Features

2.7.1 UTF-8 support

ne can load and manipulate UTF-8 files transparently, in particular on systems that provide UTF-8 I/O. See UTF-8 Support.

2.7.2 Bookmarks

It often happens that you have to browse through a file, switching frequently between a small number of positions. In this case, you can use bookmarks. There are up to ten bookmarks per document, each designated by a single digit, with the default being ‘0’. You can set them with the SetBookmark command, and you can return to any set bookmark with the GotoBookmark command. Another pair of bookmarks designated by ‘<’ and ‘>’ mark the start and end points of the last block of text you pasted into your current document. So for example GotoBookmark > will take you to the end of the most recently pasted text. Also, ne sets an automatic bookmark (designated by ‘-’) at your current position in a document whenever you use the GotoBookmark command. You can use a GotoBookmark - command to return to the location of the previous GotoBookmark command. Doing so will reset the automatic bookmark, so that subsequent GotoBookmark - commands will switch between those two locations. The special parameters ‘+1’ and ‘-1’ indicate the next or previous set bookmark in conjunction with GotoBookmark and UnsetBookmark, but reference the next or previous unset bookmark when used with SetBookmark. A sequence of GotoBookmark +1 commands lets you easily cycle through all your set bookmarks. Finally, the special parameter ‘?’ causes SetBookmark and GotoBookmark to prompt you for a bookmark designation. This prompt includes an indication of which bookmarks are already set for the current document. See SetBookmark, GotoBookmark, and UnsetBookmark. Note that in the default configuration no key binding is assigned to these commands. If you use them frequently, you may want to change the key bindings. See Key Bindings.

2.7.3 Automatic Completion

The AutoComplete command helps you extend a given prefix with matching words from your open documents. You can specify the AutoCompete command and prefix on the command line, or you can enter the prefix directly into your document and activate the AutoComplete command. With the cursor at the right end of your prefix, activate the AutoComplete command by entering either the Escape-Tab or the Escape-I key sequence, or the Control-META-I key combination, or by selecting AutoComplete from the Extras menu.

If the prefix can be extended unambiguously, the extension will be immediately inserted into your document (this is the case, for instance, if only one word matches the prefix), and a message will tell you whether the extension is an actual word or just the longest possible extension (for instance, if you expand ‘fo’ and your document contains ‘foobar’ and ‘foofoo’ then the partial match will be ‘foo’). Otherwise, ne presents you with a list of all matching words: choose the one you want and press Return, to select it; otherwise, press f1, Escape or Escape-Escape to cancel the completion operation.

The current state of the CaseSearch flag determines whether the prefix match is case sensitive. Any matching words which only exist in other open documents but not the current one are displayed in bold with an asterisk; think of that as a warning that if you select one of these bold words you will introduce a new word into your current document. Plain words already exist somewhere in your current document. See AutoComplete, and CaseSearch.

2.7.4 Automatic Bracket Matching

Unless you tell it not to (with the AutoMatchBracket command), ne will highlight any recognized bracket that matches the bracket your cursor is on if that matching bracket is currently visible on your screen. Recognized bracket pairs are ‘{}’, ‘()’, ‘[]’, ‘<>’, and ‘`'’. See AutoMatchBracket.

2.7.5 MS-DOS files

ne will detect automagically the presence of MS-DOS line terminators (CR/LFs) and set the CR/LF flag. When the file will be saved, the terminators will be restored correctly. You can change this behaviour using the PreserveCR and CRLF commands. See PreserveCR, and CRLF.

2.7.6 Binary files

ne allows a simplified form of binary editing. If the binary flag is set, only NULLs are considered newlines when loading or saving. Thus, binary files can be safely loaded, modified and saved. Inserting a new line or joining two lines has the effect of inserting or deleting a NULL. Be careful not to mismatch the state of the binary flag when loading and saving the same file.

2.7.7 File requester

The NoFileReq command deactivates the file requester. It is intended for “tough guys” who always remember the names of their files and can type them at the speed of light (maybe with the help of the completer, which is activated by the Tab key; see The Input Line).

2.7.8 Executing UN*X commands

There are three ways to execute UN*X commands from within ne. The System command can run any UN*X command; you will get back into ne as soon as the command execution terminates. See System. The Through (Meta-T) command (which can be found in the ‘Edit’ menu), however, is much more powerful; it cuts the current block, passes it as standard input to any UN*X command, and pastes the command’s output at the current cursor position. This provides a neat way to pass a part of your document through one of UN*X’s many filter commands (commands that read from standard input and write to standard output, e.g., sort). See Through. Finally, you can use the Suspend (Control-Z) command to temporarily stop ne and return to your command shell. See Suspend.

2.7.9 Advanced key bindings

ne allows you to associate any keystroke with any command, both built-in commands (with or without parameters) and macros. These associations are referred to as key bindings, which you define in your ~/.ne/.keys file. The KeyCode command allows you to see the key code ne sees in response to any key or key combination on your keyboard. It also shows the command string currently bound to that key code. This is described in Key Bindings.

The following chapters provide an exhaustive list of the remaining features of ne. See Reference.