Re: Vi retaining cursor position until after escape from insert mode
- From: Antony Scriven <adscriven@xxxxxxxxx>
- Date: Tue, 24 Jul 2007 00:20:50 -0000
On Jul 23, 10:48 pm, dirk.froemb...@xxxxxxxxxx wrote:
On 23 Jul., 15:28, Antony Scriven <adscri...@xxxxxxxxx> wrote:
On Jul 23, 10:28 am, dirk.froemb...@xxxxxxxxxx wrote:
[About a map! to leave insert mode and replace mode
without moving the cursor.]
(1) map!^X ^M^[a^M^[:--j^V^V!^V|j^V^V!^M(You don't need the `^V's before the `!'s.)
Yes you do:
No I don't.
both --j and !|j might be abbreviations and lose all
your data for you. So other keys could be mapped, but
you can't do anything about that, and I use abbreviations
heavily.
Don't be silly. Who knows what your setup is.
[...]
This is an nvi-only map. Nvi does some funky stuff with
cursor positioning which is not vi-compatible. Basically
line-wise ex commands try to be more character-wise.
Interesting; maybe the new Vi does improve on the old one.
In many ways, it's a good editor (though most folks around
here would consider vim to be the new vi).
What I had in mind was operating Vi as a stream editor of
its array of lines, each taken from the infinite alphabet
of all lines of text -- a streamlined editor, so to speak:)
Sounds a bit like the editor Sam. It doesn't break up
a buffer into lines; you can impose a structure yourself, if
you wish, using `structural regular expressions'.
So there's a price: (1) breaks a consecutive dot command,These are all showstoppers.
and it also gives away the autoindent option; much worse,
for ^X = ^[, (1) simply diverges. But that's no big deal,
either, [...]
Depends on what you are trying to accomplish.
Repeat a change!
I think the dot command has lost its appeal, now that the
cursor is in a much better position,
Hardly: change some text, move somewhere else, repeat the
change. Oops -- can't.
and dot is susceptible to line boundary anomalies,
anyway: maybe you better yank from the new position and
put the yanked text down rather than dot some command
that has once entered the text but maybe doesn't any
more.
What anomalies? Would you explain this further please?
Did you try using it on the command-line too?
I'm using it on the shell command-line without any trouble,
but you probably mean the colon command-line for the visual
Ex commands. Well, it's not particularly useful there, but
it doesn't hurt, either;
It causes problems if you use it ...
after all, escape is still around.
So you need to use both ^X and escape.
Plus it marks the buffer as modified, ...
So does plain escape even after entering the empty text.
Nvi does, vim doesn't.
... it won't work to cancel an `r' command.
So you just keep on using escape for that.
So you now need two escapes. One for insert and replace modes,
one for `r' and ex mode. Okay ...
But that's not fair: `r' is meant to quote its arguments
other than escape, which you must quote yourself.
Fair? I'm just noting that your ^X map has some problems;
you may or may not care; you may be perfectly happy using
it. I thought ^X was meant to be a replacement for ^[:
at best it is an addition.
Also check out what happens if you use ^X to cancel `60i'.
It doesn't cancel 60i at all; it accepts the newly entered
text, multiplies it, and neatly separates the 60 copies by
line breaks -- hey, a new feature;
Are you in marketing :-) That's not a new feature, that's
what 60o is for. How do you get the the old feature? Don't
tell me: the other escape.
[...]
This topic had been coming up again and again on Usenet
for decades until only a few years back, with no
satisfactory conclusion I recall.
This can be done quite trivially by simply not concerning
oneself with the issue. Brains are yet more plastic than
software.
[I have removed an incorrect extra level of quoting in the
above. You also added an extra space after the full stop in
`issue. Brains' which initially had a single space. I don't
care, but you may want to check out your setup.]
Some brains are yet more rusty than tinware and don't want
to exercise over trivial matters like constantly adjusting
arbitrary cursor displacements, if they can help it. Me, I
could not find good enough reasons to justify Vi's choice,
although many people have tried to argue in its favor. I
want a simple editor that works and spare myself the Emacs.
I notice you also break u and U. I think you are
complicating, not simplifying. --Antony
.
- Follow-Ups:
- Re: Vi retaining cursor position until after escape from insert mode
- From: dirk . froembgen
- Re: Vi retaining cursor position until after escape from insert mode
- From: Thomas Dickey
- Re: Vi retaining cursor position until after escape from insert mode
- References:
- Vi retaining cursor position until after escape from insert mode
- From: dirk . froembgen
- Re: Vi retaining cursor position until after escape from insert mode
- From: Antony Scriven
- Re: Vi retaining cursor position until after escape from insert mode
- From: dirk . froembgen
- Vi retaining cursor position until after escape from insert mode
- Prev by Date: Re: Vi retaining cursor position until after escape from insert mode
- Next by Date: vim: detecting indent method
- Previous by thread: Re: Vi retaining cursor position until after escape from insert mode
- Next by thread: Re: Vi retaining cursor position until after escape from insert mode
- Index(es):
Relevant Pages
|