[kwlug-disc] 3rd party review of the ne text editor for Linux
jvj at golden.net
jvj at golden.net
Mon Jan 15 10:53:44 EST 2018
FWIW
In a newsletter that does not usually discuss Linux or Linux
tools I cam across the following review of the ne text editor.
As I
found it interesting, I copied the review here verbatim without any sort
of personal endorsement because I have not had occasion to use ne.
I
have used vi and vim. And on the other OS I have used Notepad++. (I
still want to find a text editor that does not need to be
installed.)
Following the link I did see a reference to support for
regular expressions.
/ review_paste_start
An Introduction to ne - Nice
editor
This is an old-school text editor that runs as a console
application in the *nix shell. It replaces primitive text editors like
ed, vi, and vim, with a "nice" editor. Its executable occupies 400 KiB
on my Linux machine. It's available here [1].
WHAT I LIKE
By
default, ne displays a c source file in colors:
* #include is blue
* is cyan.
* Comments are green.
* Both opening & closing brackets
are violet.
The remaining C source lines are shown in two different
colors:
* Numeric constants are shown in a different shade of blue.
* C keywords are shown in black.
For example, in the line, PORTC =
0xFF; 0xFF is shown in blue, PORTC = is shown in black.
This can help
if you just need to change one thing-- a bit pattern, or a comment-- to
help you find it quickly. ne works for C syntax files with extensions
'.c', '.h', 'c++', etc.
If you don't want the multi-color feature,
simply disable it at startup:
$ne --no-syntax test.c
and all
characters are shown in black. I do this whenever I write files in plain
English text, as I did writing this review.
Other helpful features I
like are
* Ability to open multiple files simultaneously in
different windows; an F2 jumps to the next open window in the queue of
open files; an F3 jumps to the previous window in the queue.
* Ability
to display a reversed-color "menu" that pops up at the top of the
Konsole viewport as soon as you press and release the Esc key or the Alt
key.
It's like the old DOS text menus. You use the left/right arrow
buttons to move left/right from one keyword to the next.
There are
eight keywords. Each keyword has a list of verbs corresponding to
actions you might want to take. You choose a keyword in the list by
using the up/down arrow keys. For example, you might move the cursor
(black rectangle) to the keyword Edit to pop up a submenu of Mark block,
Cut, Copy, Paste, and so on, then push the down-arrow three times and
hit Enter to paste the contents of the paste buffer to the cursor
location. Of course, V does the same thing.
Undo/Redo Functions:
* Pressing F5 undoes the last command.
* Pressing F6 re-does the last
command.
It is possible to undo the last n commands sequentially. But I
don't know the value of n. It is at least 2.
If you have just saved
your file, and then press Undo, and then press Redo, and then quit, ne
does not bother asking if you want to save the file.
And the most
important thing -- it's free.
WHAT I DON"T LIKE
Type-setting
programs, AKA word processors, automatically wrap lines of text to fit
into a rectangular area given page left margin, page right margin, page
top margin, and page bottom margin.
Text editors don't. You have to
wrap long lines manually. Or use the GUI-based editor Kate. In Kate,
word wrap is a verb. You simply activate the menu's "Apply word wrap".
If you have already highlighted a section of text with the mouse cursor,
only the highlighted lines are wrapped. OTOH, if no text is highlighted
when you "Apply word wrap", all the text in the file is wrapped.
In ne
word wrap is BOTH a noun AND a verb. If you're in word wrap *mode*, a w
appears on the status bar. If it's off, there is no w on the status bar.
To use word wrap as a *verb*, you must obviously first set the right
margin to some value. Then type p. Ne wraps the words in that
paragraph, stopping at the end of the paragraph. So when I want to text
lines throughout the entire file, I save my file and reopen it with Kate
to do that.
WHAT ELSE I LIKE
At the bottom is a reversed-color
status bar showing the name of the file, the line number, the column
number, a percentage showing the cursor is at 95% of the way through the
file, an i if insert mode is on (otherwise, if you don't want to insert
text, press the key if you want to toggle to overwrite mode so your
keystrokes overwrite existing text -- the i disappears from the status
bar. There are 18 other "status" or "mode" characters on the status bar
that I haven't figured out yet.
No need to remember which "mode" --
insert or overwrite -- the editor is in, as with vi.
The main feature
I like about ne -- and the reason I started using it--is its Macro
feature. This is similar to the Macro feature in the old MULTI-SIM DOS
code editor from the late 20th century. A Macro is just a sequence of
keystrokes. You choose the keystrokes by typing them. Then assign that
sequence of keystrokes to any key. I typically use a function key not
already assigned to another function (for example, don't use F2 or F3
because of their navigation functions I explained above ). Then when you
press that function button, the "playback macro" feature repeats the
sequence of keystrokes you assigned to it.
This is very helpful if
you, for example, copied and pasted a half-dozen lines from another
source code file, linked the object code into executable code and ran
that executable code on the target CPU to make sure the change did
exactly what you expected it to do, and then go back to re-format the
source code to make the pasted-in code match the original code.
In
this case, for example, your sequence of keystrokes might be:
End
(move cursor to end of this line)
Down-arrow (move cursor to next
line)
Home (move cursor to column 1)
Del
Del
Del
Del
Del
End (move
cursor to end of this line)
Down-arrow (move cursor to next line)
Here the 5 Del keystrokes move the source code 5 columns to the left.
So to reindent a section of code, you simply place the cursor one line
above the starting line, and press the assigned function key once for
each line of code you want to move left. It's not foolproof. For
example, if somebody pressed TAB to indent a line of code, the first Del
deletes all the whitespace to the left of the first character, the
second Del deletes the first character, the third Del deletes the second
character, and so on. You have to watch what the Macro does as you press
the key. I do think this is a good added feature-- finding hidden
characters like the TAB.
You can also save Macros and reopen them in
another session. I haven't done that yet.
It's nice (sorry for the
pun) that you can edit text without using the mouse. It's also very nice
that most of the standard keyboard's built- in navigation keys [Home],
[End], [PageUp], [PageDown], , , , keys work as you expect.
NICE
FEATURES
ne has other features such as changing the case of all the
characters to the right of the cursor, stopping at the next word.
When
you have edited your file, you press Ctrl S to save it, then Ctrl Q to
end the program. If you press Ctrl Q without pressing Ctrl S first, and
have made a change to the file, the status line changes to "This
document is not saved; are you sure? n" and then your choice for next
keystroke becomes y or n. Nice idiot-proof feature. There's also a
character in the status line that changes when you modify the file.
When you press Ctrl S to save the file, the status line changes to
"Saved" and stays that way until you press the next key.
ne has its
quirks: For example the word-wrap function (Alt P) works only for the
paragraph the cursor is in, stopping at the end of this paragraph,
rather than continuing on to the end of the file. And you can't limit
the word-wrap function AFAIK to operate on a highlighted section of text
containing multiple paragraphs the way you can with GUI editors.
I
have only mastered a subset of ne's functions. Just the ones I need to
get the job done.
/ review_paste_end
Regards
JohnJ
Links:
------
[1] http://ne.di.unimi.it/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20180115/1beaad02/attachment.htm>
More information about the kwlug-disc
mailing list