Re: Searching: console editor with soft-wrapping
From: Logan Shaw (lshaw-usenet_at_austin.rr.com)
Date: 01/30/05
- Next message: Mr Ping: "Re: exim abandoned: unknown"
- Previous message: Kris Kennaway: "Re: pkg_add"
- In reply to: Ed Hurst: "Re: Searching: console editor with soft-wrapping"
- Next in thread: Lowell Gilbert: "Re: Searching: console editor with soft-wrapping"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 Jan 2005 11:20:00 GMT
Ed Hurst wrote:
> Us wrote:
>>Ed Hurst wrote:
>>>Does anyone know of a console editor that allows soft-wrapping? That
>>>is, it will allow wrapping text to display width but not insert line
>>>breaks.
>>
>>hmm.. vi?
> I've not seen that option. Besides, I prefer modeless editors.
Modes are not that hard when you get used to them.
In fact, I find it easiest to think of vi as not even having
modes. It just has commands. For example, "j" is the command
to move the cursor down by a line. "k" moves it up.
Likewise, "iABC<ESC>" inserts the text "ABC" before the cursor.
And "aABC<ESC>" inserts the text "ABC" after the cursor.
Don't think of "i" as switching modes and ESC as switching back.
Think of "i" as the beginning of a command and ESC as the end.
As soon as you've finished typing the text you want to insert,
hit ESC, because you wouldn't want to type in *half* a command
to the text editor. That would confuse *any* editor.
For what it's worth, if you don't want modes, you'll have to rule
out other editors as well. For instance, in emacs there is the
command C-x C-s (control-x control-s), which saves the current
buffer. There is also the command C-s, which initiates an
interactive search. So, C-s behaves differently depending on
what keys you have already typed. One could say it depends on
the context (of the previous input). It's every bit as much a
mode as it is in "vi" when you type "i" and afterwards typing
"j" would cause "j" to get inserted into the document instead
of causing the cursor to move down a line.
So, the difference here is not that one editor has modes and
the other doesn't. They both have modes. In fact, most editors
I've ever seen have modes[1].
The difference with vi is that using a mode is required in order
to insert text. On 99% of the other text editors out there,
you can just load the thing up and start typing letters and
numbers and spaces, and they immediately go in the document.
That, I think, is what trips up most people about vi. They load
it up and expect it to work like other editors they've used before,
and it doesn't, and they conclude that it's complicated. But it's
not complicated; it's just works in a way which is different from
what you're used to. In fact, vi is quite simple when you
understand how it works.
- Logan
[1] There are probably some that don't. It might be that pico
doesn't have modes. I don't use it much, but I think it
mainly has one-character commands for things. Which is,
by the way, equivalent to not having modes. But having
only one-character commands limits you because then you
can't have that many different commands!
- Next message: Mr Ping: "Re: exim abandoned: unknown"
- Previous message: Kris Kennaway: "Re: pkg_add"
- In reply to: Ed Hurst: "Re: Searching: console editor with soft-wrapping"
- Next in thread: Lowell Gilbert: "Re: Searching: console editor with soft-wrapping"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|