The main arguments you can give to
ne are the names of files you
want to edit. They will be loaded into separate documents. If you
-h anywhere on the command line, a simple help text
ne’s arguments will be printed.
+N option causes
ne to advance to the Nth
line of the next document loaded. This option is fairly common among
editors and text display programs like
N itself is optional. Without it, a bare
+ on the command
ne to advance to the last line of the first
document. You can specify a line and column as
non-digit can be used to separate the N from the M. As it
only affects the next document loaded, it can appear multiple times on
the command line.
--binary option causes
ne to load the next document
in binary mode. Binary mode treats the normal line termination
characters as any other character and only breaks lines on NULL
--binary only affects the next
document loaded, and it can appear multiple times on the command line.
--ro option causes
ne to load the next named file
into a read-only document. You can’t modify a read-only
document without first taking special action such as turning off the read-only
flag. You can still
Save (Save) a read-only document to a
file if the file’s permissions allow it, but
ne will prompt you
before attempting to save a document marked read-only.
--read-only option only affects the next document loaded,
so it can appear multiple times on the command line. A document’s
read-only flag is automatically set when a file is loaded if the
corresponding file is not writable (as determined by the
system call) regardless of whether the
--read-only option is used. See
--noconfig option skips the reading of the key
bindings and menu configuration files (see Configuration). This is
essential if you are experimenting with a new configuration and you make
mistakes in it.
--prefs extension option makes
ne load a specified
set of automatic preferences, that is, those associated with the provided
extension, instead of the default ones, before loading the first file.
It can be useful, for instance, when piping a file into
ne or when
reading from named pipes, as in those cases there is no file extension
ne can guess the correct preferences. Note that preferences
are cloned from the current document when a new document is created, so if
you open a number of files without extension this option will propagate
to all of them.
--macro filename option specifies the name of a
macro that will be started just after all documents have been loaded. A
typical macro would move the cursor to a certain line.
--keys filename option and the
filename option specify a name different from the default one
(.keys and .menus, respectively) for the key bindings and
the menu configuration files. Note that
ne searches for these
files first in the current directory, and then in your ~/.ne
--ansi and the
--noansi options manage
ne’s built-in ANSI sequences. Usually
ne tries to retrieve
from your system some information that is necessary to handle your
terminal. If for some reason this is impossible, you can ask
to use a built-in set of sequences that will work on many terminals
--ansi option (to be true,
ne can be even
compiled so that it uses directly the built-in set, but you need not
know this). If you want to be sure (usually for debugging purposes) that
ne is not using the built-in set, you can specify
--no-syntax option disables
ne’s normal syntax
highlighting capability. For most editing situations, this would be
unnecessary, but for extremely large files it may be helpful. Syntax
highlighting incurs small memory usage and processor overhead penalties
for each line of text. The
--no-syntax option eliminates that
overhead. Note that files longer than ten million bytes will have
syntax highlighting disabled by default, but it is possible to re-enable it.
See Syntax Highlighting.
--no-utf8 options can be used to
force or inhibit UTF-8 I/O, overriding the choice imposed by the system
locale. Note, however, that in general it is more advisable to set the
LANG environment variable to a locale supporting UTF-8 (you can
usually see the locale list with
locale -a). See UTF-8 Support.
If you need to open a file whose name starts with ‘--’, you can put ‘--’ before the filename, which will skip command recognition for the next word.
You can use I/O redirection to pipe the output of other commands into your first document. For example,
ls -l | ne file1.txt --read-only file2.txt
will open three documents: an unnamed document containing the output of
ls -l command, the contents of file1.txt, and the contents
of file2.txt with the read-only flag set.
It’s possible to apply the
+N,M options to the piped unnamed document by referencing it as a
-. Only the first such file name will reference the piped
document (even if it isn’t the first file name on the command line).
Subsequent dashes will be considered normal file names. If you want the first
dash to be treated like a normal file instead of a reference to the piped
document, prefix the dash with ‘--’. Consider these two command lines:
ls -l | ne --read-only +3,8 - file1.txt - ls -l | ne file1.txt -- - --read-only +3,8 - ls -l | ne --binary file1.txt --read-only -- -
All three of these commands open
ne with three documents: the output
ls -l command will be in the first unnamed document, the
contents of file1.txt will be in the second document, while the third
document will contain the contents of the file - (or an empty document
with that name if there is no such file). The first and second commands do
exactly the same thing: the unnamed first document is marked read-only and
the cursor is positioned on line 3 column 8, while the other two document are
opened normally. In the case of the third command, file1.txt is opened
in binary mode, the document named - is marked read-only, while the
first, unnamed, document—which is not referenced on the command line—with
the output from
ls -l is opened normally.
ne has a global directory where the system
administrator can store macros, default preferences, and syntax
definitions for all users of the system. The location of this directory
is defined when
ne is built, but you can override it by creating
and exporting the
NE_GLOBAL_DIR environment variable prior to
ne. If you load no files when you start
if you invoke the
About command, it will display a splash
screen. The last line on that screen shows the global directory
ne is using, if it exists, or an error message otherwise.