### 2.5 Basic Preferences

`ne` has a number of flags that specify alternative behaviors, the most prototypical example being the insert flag, which specifies whether the text you type is inserted into the existing text or overwrites it. You can toggle this flag with the ‘`Insert`’ menu item of the ‘`Prefs`’ menu, or with the <Insert> key of your keyboard. (Toggle means to change the value of a flag from true to false, or from false to true; see Insert.)

Another important flag is the free form flag, which specifies whether the cursor can be moved beyond the right end of each line of text or only to existing text (a la `vi`). Programmers usually prefer non free form editing; text writers seem to prefer free form. See FreeForm for some elaboration. The free form flag can be set with the ‘`Free Form`’ menu item of the ‘`Prefs`’ menu.

At this point, we suggest you explore by trial and error the other flags of the ‘`Prefs`’ menu, or try the `Flags` command (see Flags), which explains all the flags and the commands that operate on them. We prefer spending a few words discussing automatic preferences or autoprefs.

Having many flags ensures a high degree of flexibility, but it can turn editing into a nightmare if you have to turn on and off dozens of flags for each different kind of file you edit. `ne`'s solution is to automatically set a document's flags when a file is loaded based on your stated preferences for each file type. A file's type is determined by the extension of its file name, that is, the last group of letters after the last dot. For instance, the extension of `ne.texinfo` is ‘`texinfo`’, the extension of `source.c` is ‘`c`’, and the extension of `my.txt` is ‘`txt`’.

Whenever you select the ‘`Save AutoPrefs`’ menu item, `ne` saves the flags of your current document to be used when you load other files with the same extension as your current document. These autoprefs are saved in a file in your `~/.ne` directory. This file has the same name as the extension of the current document with ‘`#ap`’ appended to it. It contains all the commands necessary to recreate your current document's flag settings. Whenever you open a file with this file name extension, `ne` will automagically recreate your preferred flag settings for that file type. (There is a flag that inhibits the process; see AutoPrefs.)

Finally, when you select the ‘`Save Def Prefs`’ menu item, a special preferences file named `.default#ap` is saved. These preferences are loaded whenever `ne` is run before loading any file. This is how you set up the preferences you always want to be set.

A small set of preferences are global to `ne` rather than specific to particular document types. Thus they are saved in the `.default#ap` file by the `SaveDefPrefs` command or the ‘`Save Def Prefs`’ menu. They are not saved by the `SaveAutoPrefs` command. These preferences are: `FastGUI`, `RequestOrder`, `StatusBar` and `VerboseMacros`; see FastGUI, See RequestOrder, See StatusBar, and See VerboseMacros.

Similarly, the current syntax definition is specific to the current document type, so it is saved only in autoprefs files by the `SaveAutoPrefs` command or ‘`Save AutoPrefs`’ menu; it is not saved in the `.default#ap` file.

Note also that a preferences file is just a macro (as described in the following section). Thus, it can be edited manually if necessary.