Re: How to fix vi to take the arrow keys
- From: Brian Masinick <masinick@xxxxxxxxx>
- Date: Wed, 15 Mar 2006 21:50:23 -0500
Jerry Peters <jerry@xxxxxxxxxxxxxxx> writes:
pat foley <mbox5000@xxxxxxxxxxxxx> wrote:
On 2006-03-14, Jerry Peters <jerry@xxxxxxxxxxxxxxx> wrote:
mark <mark@xxxxxxxxxx> wrote:
On Mon, 13 Mar 2006 07:52:32 -0800, geek wrote:But they don't work in insert or replace mode whereas the arrow keys
My vi editor does not take the delete and other arrow keys to effect.
Somebody else here got flamed for saying this but I'll repeat it anyhow.
Use the "hjkl" keys to navigate rather than the arrow keys.
Apart from avoiding the keyboard/mapping problem you are experiencing,
real vi/vim users use these keys mainly because they are more accessible
on the keyboard and therefore quicker to use (i.e. they fit the vi/vim
mantra of efficiency). The hjkl keys are right under your hands at all
times.
I realize it takes a short time to embed those keys into your habits,
but believe me it is worthwhile in the long term.
do, so if I'm in insert mode, I need to go to command mode, move, then
go back to insert mode. Explain to me again how this is more efficient
than just using the arrow keys?
1. This is not an argument. Compare: "My bike is no good for getting
around indoors, therefore it's less efficient than walking." Efficiency
and ubiquity are not the same thing.
Your analogy is not comparable; again I have to reach to hit the
escape key to enter command mode, move the cursor, then go back to
insert mode and continue typing.
2. You cannot use a numeric prefix with the arrow keys -- or otherwise
combine movement and command -- except in command mode either.
So what, I normally don't; it's much easier to just hit the arrow keys
rather than counting the number of characters to move, then keying in
some-number<movement command>.
3. There is reason to think hjkl use is more efficient in command mode
than using arrow keys, since all the other commands are nearby (x, c, d,
y, etc., all those other single-letter commands we can't live without.)
I can move to the arrow keys and back at least as fast as
I can return to command mode, then use hjkl.
Keyboards have had arrow keys for the 30-odd years I've been using
them, why should I care that the keyboard Bill Joy used to develop vi
didn't? Or that it had little arrows on the hjkl keys, which is a
story I've heard.
4. Frequent use of the arrow keys or hjkl for navigation is terribly
inefficient anyway. Movement by bigger (logical) chunks or by searching
or even by line numbers is better. The very presence of arrow keys on
your keyboard is a temptation to inefficiency. ;-)
So what? If I need to search, then I use / or ? (which on my keyboard,
BTW, are just above and to the left of the arrow keys).
This is your opinion of efficiency, mine is apparently different.
While I'm editting something, I prefer to keep my thoughts on the
changes I'm making, not calculating the most "efficient" way to move
around in the file. One of the reasons I detest GUI editors is the
searching, it interrupts my train of thought to fill in the pop-up
windows they typically use for find. I can type /something without
having to think about it. That is my definition of efficiency in
editting, I shouldn't have to think about _how_ to make simple edits,
it should be automatic. hjkl is _not_ automatic and I see no good
reason to expend the effort to make them so.
5. Some of the rhetorical force in your post comes from the business
about switching back & forth between command and insert modes. Are you
sure you like vi? What you say above sounds more like an argument for
modeless editing.
But I don't like things like Ctl-Ctl-x and other emacs abominations.
vim is fine, I can use the arrow keys in command and insert mode as
necessary, along with page{up,down}, insert & delete. Although I must
admit that I usually use delete only very occasionally when in insert
mode.
Face it, those of us who have been using keyboards with arrows on them
for years see absolutely no reason to use the archaic hjkl keys just
because of vi purists.
Jerry, I see your point about using arrow keys instead of hjkl. I
also see Pat's point on this. My observation, from watching quite a
few vi users is that there are quite a few fairly frequent vi users
(and I could easily apply the same argument to Emacs users, xedit
users, and Joe users, just to name a few other editors) who use a
relatively small subset of the features that are available.
I sometimes sit there, and occasionally make comments, like, "Why
don't you use the 20j command to jump down twenty lines real fast
instead of holding the down arrow key", or "Why don't you type in dw
to delete a word or d5w to delete five words instead of hitting the
backspace or the x key repeatedly to delete multiple words of text"?
.... and similar kinds of things.
But I can see your point. Maybe I don't feel like filling my head
with fifty different commands to micro edit something. Maybe I just
want to concentrate on the algorithm I am writing or maybe I want to
concentrate on the style of my writing or maybe I just want to do
something quickly and I don't have time to figure out the optimum way
to do it (and waste hours learning that optimum way). These are
things I have noticed from others, and they are technically astute,
but they could care less about the finer points of vi, emacs, joe,
jed, NEdit, or <you-fill-in-the-blank>.
Is that anywhere near capturing the spirit or intent of your argument?
If it is, there are many others like you out there. In this
newsgroup, people tend to be passionate about their editors. But when
you are on the job, I find 80-90% of the people who have an attitude
much closer to the comments I noted in the previous paragraph.
Though I happen to be from the school of those who want to know
different ways to do things, I find that there are far more people who
just do what it takes to get the real job done. Yeah, they know vi or
they know Emacs. But most of them know just enough commands to do the
basics, and not much more, even if they are VERY sharp programmers,
business analysts, or writers.
--
Brian Masinick
mailto:masinick@xxxxxxxxx
.
- Follow-Ups:
- Re: How to fix vi to take the arrow keys
- From: Jerry Peters
- Re: How to fix vi to take the arrow keys
- From: mark
- Re: How to fix vi to take the arrow keys
- References:
- How to fix vi to take the arrow keys
- From: geek
- Re: How to fix vi to take the arrow keys
- From: mark
- Re: How to fix vi to take the arrow keys
- From: Jerry Peters
- Re: How to fix vi to take the arrow keys
- From: pat foley
- Re: How to fix vi to take the arrow keys
- From: Jerry Peters
- How to fix vi to take the arrow keys
- Prev by Date: Re: how do i reassign my escape key to my caps lock key
- Next by Date: Re: Great free, non commercial, non modal console text editors
- Previous by thread: Re: How to fix vi to take the arrow keys
- Next by thread: Re: How to fix vi to take the arrow keys
- Index(es):
Relevant Pages
|