Isn't there any concept of selection? Why not?

67 views
Skip to first unread message

jason404

unread,
Aug 2, 2011, 5:41:49 AM8/2/11
to nicee...@googlegroups.com
In am very used to using SHIFT with (and without) the CTRL key, together with the four Arrow keys or the Home and End keys, and all combinations of those, to select blocks of text.  I then start typing to replace that selected text, or use the Delete key.

Why isn't there anything like this in Ne (or any other console-based text editor I have seen)?  Is it a technically limitation of terminals?

How do I select or just delete blocks of text in Ne?

Sebastiano Vigna

unread,
Aug 2, 2011, 10:13:29 AM8/2/11
to nicee...@googlegroups.com
On Aug 2, 2011, at 2:41 AM, jason404 wrote:

> Why isn't there anything like this in Ne (or any other console-based text editor I have seen)? Is it a technically limitation of terminals?

Correct.

> How do I select or just delete blocks of text in Ne?

RTFM. :)

Ciao,

seba


utoddl

unread,
Aug 2, 2011, 11:34:04 AM8/2/11
to nicee...@googlegroups.com
This is indeed a limitation of terminals.

A keyboard directly connected to a computer (almost) provides an array of switches, the state of any of which can be determined by the driver and passed on to the GUI or interested programs. It's just by convention that certain ones of those switches are used for letters, shifts, functions, cursor movement, and how they interact is entirely under software control.

Terminals, however, are a different beast altogether. They see only a stream of incoming bytes. With the exception that delays before/after certain special bytes might cause different interpretations, a given sequence of bytes implies a particular interpretation according to a fixed protocol. That protocol does not include anything that would mean "the user held the shift key while pressing the left cursor key". You could have a keyboard with separate keys for upper and lower case letters and no shift key at all and it would not matter to the terminal program at all. What keys you press to generate the byte stream is totally irrelevant. In fact, there's no way for a terminal program to distinguish between Ctrl+M and the Enter key; they produce exactly the same bytes "on the wire" connected to the terminal's input buffer.

What's throwing you (and most potential ne users) is that ne does not provide visual feedback on selections. I know that's a big switch relative to other (especially GUI based) editors, but it's really not such a big deal once you get used to it. Ctrl+B marks one end of a block. Your cursor -- wherever it is -- marks the other end. Ctrl+X, Ctrl+C, and Ctrl+V do the normal cut/copy/paste you're familiar with.

You also get rectangular selections with Ctrl+@ instead of Ctrl+B (you may have to Ctrl+Shift+2 on some terminals), and rectangular pastes with Ctrl+W. They're pretty cool.

These all use the default clip (clip 0), but you've got clips 0 through 9 to work with. Pretty neat capabilities in the block operations department.

Give these a try and let us know what you think. Thanks for trying ne.

jason404

unread,
Aug 6, 2011, 12:30:47 PM8/6/11
to nicee...@googlegroups.com
Thanks for the explanation.  I was just curious to why it was not possible when it is possible in Windows console text editors, but then, I suppose they are not really running through a terminal emulator.

I have given up trying to learn vim and I never liked nano, but I have taken to ne very easily.

jason404

unread,
Aug 6, 2011, 12:33:08 PM8/6/11
to nicee...@googlegroups.com
...I've not tried much of the more advanced capabilities yet, so I'll probably have more questions.  The block operations are very nice, but I need to do more experimenting with vertical pastes and figure out how clips work.
Reply all
Reply to author
Forward
0 new messages