Tell HN: A request for saner text-editors
The crux of this problem comes down to navigation and newlines. Traditional unix text editors understand a new line as ending when the newline character appears. This means a line can span many 'rows' on the screen. This makes sense because this is how lines are represented internally. But unless you think this way--and you wouldn't unless you habitually think in low level computer representation and don't often use saner text editors--navigation in such text-editors is quite un-natural.
For example, let's say you're reading back some text you've written and find you want to change something. Your initial reaction is to navigate to that error from where you are at the moment. So, you find where the cursor is located and say something like, "five lines up and a bit to the left." But you can't directly do this with the arrow keys or key shortcuts, because you're thinking about lines in a fundamentally different way to such a text-editor.
In everyday life we navigate objects visually. We should be able to navigate the cursor in text-editors in the same way. And so I implore the developers of future text-editors to make the default navigation behaviour to understand lines as how they are visually represented, not how they are internally represented. Please.
10 comments
[ 4.5 ms ] story [ 36.5 ms ] threadI can't speak to Emacs, but Vim assumes that if you put something on the same line, you want it treated as a single line, regardless of where your window is causing text to wrap. For example, dd deletes your whole line, not just the window's line. I think this makes perfect sense in the Vim context, particularly since Vim is geared a bit more towards coding than word processing. How weird would it be to dd
and end up with left in your editor, no doubt breaking your code?In this case, the complaint is that what you've got can't be represented by what you see. There are a couple of ways to approximately display what you see, but they're approximations. (One is wrap and the other is "off the edge of the screen".)
In a WYSIWYG, you can't represent a line longer than the screen width. This is a problem when lines matter.
That's why WYSIWYG is more accurately called "What You See Is All You Have".
If navigation behavior is to change, there must still be some way for the editor to show the wrapping points. One option is Unicode, which is now fairly well supported by editors and terminals; for instance, special symbols like "¬" could be used to show wrapping points.
Most of the time, it makes editing text easier, as one would expect. The exception is when using a keyboard macro to do something to a bunch of lines. It's common for such macros to have a form like
1) start at the beginning of the line 2) do stuff to the line 3) go to the beginning of the next line
When the navigation commands take line wrap into effect, you can wind up with a macro that gets run once on short lines, but twice on long lines.