what is the origin

classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

what is the origin

linda.s
Just curious,
for switching modes: "i" for current location and "a" for after the
current location.
There are too many things needed to be remembered. As a beginner in
VIM, I wonder what the origin of these commands, that is, why named
after these?
L.
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Chris Allen
On 2/8/06, linda.s <[hidden email]> wrote:
> Just curious,
> for switching modes: "i" for current location and "a" for after the
> current location.

'i' for 'insert' and 'a' for 'append after the cursor'

> There are too many things needed to be remembered.

Start with a few basics at a time and you'll learn them through
practice in no time at all.  Eventually you will find that you can
edit files much, much faster using Vim than with the more common and
weaker editor paradigms which have popped up recently.  (The 'vi'
editor concept is about 30 years old, and among the first 'visual'
editors.)

> As a beginner in
> VIM, I wonder what the origin of these commands, that is, why named
> after these?

Most of them have a handy mnemonic.  'i' is short for 'insert', 'a' is
short for 'append'.  Both of these commands are cursor-relative.
Since you're already familiar with 'i' and 'a' there are 'I' and 'A',
which are identical, but function at the line ends ('I' for 'insert at
the start of the line' and 'A' for 'append at the end of the line').
'o' and 'O' are both variations on 'open a new line', 'e' goes to the
'end of the next word', and so on.

Hope that helps,
Chris Allen
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Matthew Winn
In reply to this post by linda.s
On Wed, Feb 08, 2006 at 01:42:06AM -0800, linda.s wrote:
> Just curious,
> for switching modes: "i" for current location and "a" for after the
> current location.
> There are too many things needed to be remembered. As a beginner in
> VIM, I wonder what the origin of these commands, that is, why named
> after these?

i = insert
a = append

The original documentation for vi attempted to provide mnemonics for
many of the most frequently used commands, so you had things like:

a  = Append after cursor  (A = Append at end of line)
c  = Change specified text  (C = Change to end of line)
d  = Delete specified text  (D = Delete line)
i  = Insert before cursor  (I = Insert at start of line)
o  = Open new line below  (O = Open above)
u  = Undo last change  (U = Undo line)

y  = Yank into register  (Y = Yank line)
p  = Put yanked text below  (P = Put above)

b  = Back a word  (B = Back ignoring punctuation; also W, E)
w  = forward a Word
e  = End of word
^B = Backward one page
^F = Forward one page
G  = Go to line
H  = Home screen line (top)
M  = Middle screen line
L  = Last screen line
^U = scroll Up
^D = scroll Down
^Y = scroll up one line (Y is next to U)
^E = scroll down one line (E is above D)
     (OK, those last two are a bit dodgy)

f  = Find in line  (F = Find backwards)
t  = find To in line (i.e. the character before the one reached by "f")

--
Matthew Winn ([hidden email])
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

linda.s
On 2/8/06, Matthew Winn <[hidden email]> wrote:

> On Wed, Feb 08, 2006 at 01:42:06AM -0800, linda.s wrote:
> > Just curious,
> > for switching modes: "i" for current location and "a" for after the
> > current location.
> > There are too many things needed to be remembered. As a beginner in
> > VIM, I wonder what the origin of these commands, that is, why named
> > after these?
>
> i = insert
> a = append
>
> The original documentation for vi attempted to provide mnemonics for
> many of the most frequently used commands, so you had things like:
>
> a  = Append after cursor  (A = Append at end of line)
> c  = Change specified text  (C = Change to end of line)
> d  = Delete specified text  (D = Delete line)
> i  = Insert before cursor  (I = Insert at start of line)
> o  = Open new line below  (O = Open above)
> u  = Undo last change  (U = Undo line)
>
> y  = Yank into register  (Y = Yank line)
> p  = Put yanked text below  (P = Put above)
>
> b  = Back a word  (B = Back ignoring punctuation; also W, E)
> w  = forward a Word
> e  = End of word
> ^B = Backward one page
> ^F = Forward one page
> G  = Go to line
> H  = Home screen line (top)
> M  = Middle screen line
> L  = Last screen line
> ^U = scroll Up
> ^D = scroll Down
> ^Y = scroll up one line (Y is next to U)
> ^E = scroll down one line (E is above D)
>     (OK, those last two are a bit dodgy)
>
> f  = Find in line  (F = Find backwards)
> t  = find To in line (i.e. the character before the one reached by "f")
>
> --
> Matthew Winn ([hidden email])
>
curious about the origin of cursor keys such as h,l,k,j?
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Chris Allen
On 2/8/06, linda.s <[hidden email]> wrote:
> curious about the origin of cursor keys such as h,l,k,j?

Those keys had two nice features back in the early days:

1)  They were very easy to reach.  You can navigate without leaving
the 'home row' of they keyboard.

2) They were supported on every terminal everywhere under all condtions.


Hope that helps,
Chris Allen
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Matthew Winn
In reply to this post by linda.s
On Wed, Feb 08, 2006 at 02:49:58AM -0800, linda.s wrote:
> curious about the origin of cursor keys such as h,l,k,j?

Quite apart from the fact that they're easy to reach, some early
terminals used control-H, J, K and L as cursor keys.  The keyboards
didn't have separate cursor keys: you had to press control and the
letter.  Some keyboards even had little arrows on the front face of
the keycaps to show the effect they would have.  You can just make
them out on this picture of an ADM-3A:

    <http://homepage.mac.com/tadd/comphist/adm_3a.jpg>

(The original vi documentation specifically mentions the ADM-3A when
it describes the use of h, j, k and l, so that's almost certainly how
the letters were chosen.)

--
Matthew Winn ([hidden email])
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Tim Chase-2
In reply to this post by Matthew Winn
> ^Y = scroll up one line (Y is next to U)
> ^E = scroll down one line (E is above D)
>      (OK, those last two are a bit dodgy)

No wonder I always have trouble remembering these ;)

Actually, when it comes to scrolling, I can sorta remember
because the "Y" looks like a funnel, "bringing lines down
from above".  However, using ^E and ^Y within insert mode is
a bit trickier to remember for me for some reason.

-tim




Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Charles E Campbell Jr
In reply to this post by linda.s
linda.s wrote:

>curious about the origin of cursor keys such as h,l,k,j?
>
>  
>
A popular terminal in those days was the vt100.  It still often appears
in termcap and terminfo support.
The keyboard had arrow keys printed on the hjkl keys in the directions
that vi/vim uses; however, the
vt100 preceded vi.  Bill Joy used an ADM3A terminal to write vi on; I
think it too had arrow keys printed
on the hjkl keys.

IMHO that is a fortuitous circumstance, as it makes editing go faster
when I don't have to take my attention
off the screen to find the cursor keys (or mouse) -- a touch-typing benefit.

Regards,
Chip Campbell
Reply | Threaded
Open this post in threaded view
|

RE: what is the origin

Gene Kwiecinski
In reply to this post by linda.s
>for switching modes: "i" for current location and "a" for after the
>current location.
>There are too many things needed to be remembered. As a beginner in
>VIM, I wonder what the origin of these commands, that is, why named
>after these?

Goes back to the original 'vi' that came with nigh every Unix system.
There're plenty of "tutorials" on things like keycode "meanings", which
would probably be good to look up on your own, too.  I haven't done so
in aeons, so I don't know of any offhand.

But for a quicky list, you have

        i insert (before)
        a append (after)
        o open a line (below)
        r replace 1 char
        s substitute N chars
        x delete ("x-out") the char under the cursor

etc.

Uppercase does the extreme or opposite of the lowercase chars, eg

        I insert at the very beginning of a line
        A append at the very end...
        O open a line *above*
        R replace 'til you hit <esc> (essentially overstrike mode)
        X delete the char *before* the cursor

etc.
Reply | Threaded
Open this post in threaded view
|

RE: what is the origin

Gene Kwiecinski
In reply to this post by linda.s
>letter.  Some keyboards even had little arrows on the front face of
>the keycaps to show the effect they would have.  You can just make
>them out on this picture of an ADM-3A:
>   <http://homepage.mac.com/tadd/comphist/adm_3a.jpg>

Heh, I got 2 of 'em in my museu-, ummm, basement, along with some
Televideo {TV910|TV910+|TV920}s, an ADM42, and an ADM-11.  Even got a
Datapoint 3600(?) with a DD50 connector instead of the usual DB25...
what a nightmare trying to figure out the pinout for *that* with no
spex...

Ahhh, the memories...  :D
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Matthew Winn
On Wed, Feb 08, 2006 at 10:54:04AM -0500, Gene Kwiecinski wrote:
> >letter.  Some keyboards even had little arrows on the front face of
> >the keycaps to show the effect they would have.  You can just make
> >them out on this picture of an ADM-3A:
> >   <http://homepage.mac.com/tadd/comphist/adm_3a.jpg>
>
> Heh, I got 2 of 'em in my museu-, ummm, basement, along with some
> Televideo {TV910|TV910+|TV920}s, an ADM42, and an ADM-11.

I remember using an ADM-3A with an overly bright tube.  You could feel
it bleaching your eyeballs as you used it.  And there was one bit of kit
where the only way to get advanced characters like Escape and Backspace
was to type control-[ and control-H respectively.  Vi was perfect for
that sort of equipment.  Emacs wouldn't have a chance: Alt? What's that?

> Even got a
> Datapoint 3600(?) with a DD50 connector instead of the usual DB25...
> what a nightmare trying to figure out the pinout for *that* with no
> spex...

You had connectors?  Eeee, when I were a lad we 'ad to carry the bits
between the computer and the terminal with a spoon...

--
Matthew Winn ([hidden email])
Reply | Threaded
Open this post in threaded view
|

:find with autocompletion?

Carlos Beltran

Hello,

I was wondering if the :find command to search for files can be improved to
include autocompletion of the filename. I usually work with hundreds of
files and can not remember the exact name of all of them, thus :find is most
of the time of no use at all. Is there a way to find files with name
autocompletion and with "ignorecase" capability??

Thanks,

Carlos.

Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

A.J.Mechelynck
In reply to this post by Chris Allen
Chris Allen wrote:

> On 2/8/06, linda.s <[hidden email]> wrote:
>> curious about the origin of cursor keys such as h,l,k,j?
>
> Those keys had two nice features back in the early days:
>
> 1)  They were very easy to reach.  You can navigate without leaving
> the 'home row' of they keyboard.
>
> 2) They were supported on every terminal everywhere under all condtions.
>
>
> Hope that helps,
> Chris Allen

... and for those of us who don't anymore have "museum" keyboards (see
later replies), here are the mnemonic tricks I use:

- hjkl are under your right hand when you type
- h (character left) is the leftmost of them
- l (character right) is the rightmost of them
- j (line down) has a downward-pointing tail
- k (line up) has an upward-pointing tail

I didn't make them up, but I don't remember where I read them.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: :find with autocompletion?

Luc Hermitte
In reply to this post by Carlos Beltran
Hello,

Carlos Beltran <[hidden email]> wrote:

> I was wondering if the :find command to search for files can be improved to
> include autocompletion of the filename. I usually work with hundreds of
> files and can not remember the exact name of all of them, thus :find is most
> of the time of no use at all. Is there a way to find files with name
> autocompletion and with "ignorecase" capability??

The latest improvements on searchInRuntime (script #229 on SF) offer such
capabilities. However, I used vim7.x unique features to implement some of the
new commands.
Actually, :find is not defined (I defined instead other commands (:Split,
:Vsplit, ...)), but it is quite easy to add.

Regarding ignorecase, it is not supported I think.

HTH,

--
Luc Hermitte
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Bugzilla from peterp@stack.nl
In reply to this post by A.J.Mechelynck
Op woensdag 8 februari 2006 17:50, schreef A. J. Mechelynck:

> Chris Allen wrote:
> > On 2/8/06, linda.s <[hidden email]> wrote:
> >> curious about the origin of cursor keys such as h,l,k,j?
> >
> > Those keys had two nice features back in the early days:
> >
> > 1)  They were very easy to reach.  You can navigate without leaving
> > the 'home row' of they keyboard.
> >
> > 2) They were supported on every terminal everywhere under all condtions.
> >
> >
> > Hope that helps,
> > Chris Allen
>
> ... and for those of us who don't anymore have "museum" keyboards (see
> later replies), here are the mnemonic tricks I use:
>
> - hjkl are under your right hand when you type
> - h (character left) is the leftmost of them
> - l (character right) is the rightmost of them
> - j (line down) has a downward-pointing tail
> - k (line up) has an upward-pointing tail

And they're in the same order as the cursor keys on the Sinclair ZX
Spectrum :)
http://www.guybrush.demon.co.uk/spectrum/docs/Keys.gif


Peter
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Stefan Karlsson-3
In reply to this post by Matthew Winn


Matthew Winn skrev:

> On Wed, Feb 08, 2006 at 10:54:04AM -0500, Gene Kwiecinski wrote:
>>> letter.  Some keyboards even had little arrows on the front face of
>>> the keycaps to show the effect they would have.  You can just make
>>> them out on this picture of an ADM-3A:
>>>   <http://homepage.mac.com/tadd/comphist/adm_3a.jpg>
>> Heh, I got 2 of 'em in my museu-, ummm, basement, along with some
>> Televideo {TV910|TV910+|TV920}s, an ADM42, and an ADM-11.
>
> I remember using an ADM-3A with an overly bright tube.  You could feel
> it bleaching your eyeballs as you used it.  And there was one bit of kit
> where the only way to get advanced characters like Escape and Backspace
> was to type control-[ and control-H respectively.  Vi was perfect for
> that sort of equipment.  Emacs wouldn't have a chance: Alt? What's that?
>
>> Even got a
>> Datapoint 3600(?) with a DD50 connector instead of the usual DB25...
>> what a nightmare trying to figure out the pinout for *that* with no
>> spex...
>
> You had connectors?  Eeee, when I were a lad we 'ad to carry the bits
> between the computer and the terminal with a spoon...
>

You were lucky to have a LAKE! There were a hundred and sixty of us
living in a small shoebox in the middle of the road.

Cardboard box?

Aye.

You were lucky. We lived for three months in a brown paper bag in a
septic tank. We used to have to get up at six o'clock in the morning,
clean the bag, eat a crust of stale bread, go to work down mill for
fourteen hours a day week in-week out. When we got home, our Dad would
thrash us to sleep with his belt!

:-)

Reply | Threaded
Open this post in threaded view
|

RE: what is the origin

Gene Kwiecinski
In reply to this post by linda.s
>I remember using an ADM-3A with an overly bright tube.  You could feel
>it bleaching your eyeballs as you used it.  And there was one bit of
kit

??  Didn't they have that dinky little brightness control either as a
knobbed pot towards the top-right(?) of the keyboard, else the
thumbwheel-thingy along the bottom edge?

Running joke around the 'puter center waaay back when was to sneak up on
someone typing on a '3A, crank the brightness pot alllll the way up 'til
the letters would get all bright and fuzzy and the displayed area of the
screen would shrink at least a half-inch, then whisper to the person,
"Go sterile... go sterile...".
Reply | Threaded
Open this post in threaded view
|

RE: what is the origin

Gene Kwiecinski
In reply to this post by linda.s
>>>Even got a
>>>Datapoint 3600(?) with a DD50 connector instead of the usual DB25...
>>>what a nightmare trying to figure out the pinout for *that* with no
>>>spex...
 
>>You had connectors?  Eeee, when I were a lad we 'ad to carry the bits
>>between the computer and the terminal with a spoon...

>You were lucky to have a LAKE! There were a hundred and sixty of us
>living in a small shoebox in the middle of the road.

Yah, well, we had to carve our electrons out of driftwood we'd find.  In
the winter.  Uphill.  Both ways.


>You were lucky. We lived for three months in a brown paper bag in a
>septic tank. We used to have to get up at six o'clock in the morning,
>clean the bag, eat a crust of stale bread, go to work down mill for
>fourteen hours a day week in-week out. When we got home, our Dad would
>thrash us to sleep with his belt!

You got to work at a mill?  Lucky!  I got sent back to work in the
acid-mines for my daily crust of stale bread... which not even the birds
would eat.
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Stefan Karlsson-3


Gene Kwiecinski skrev:

>>>> Even got a
>>>> Datapoint 3600(?) with a DD50 connector instead of the usual DB25...
>>>> what a nightmare trying to figure out the pinout for *that* with no
>>>> spex...
>  
>>> You had connectors?  Eeee, when I were a lad we 'ad to carry the bits
>>> between the computer and the terminal with a spoon...
>
>> You were lucky to have a LAKE! There were a hundred and sixty of us
>> living in a small shoebox in the middle of the road.
>
> Yah, well, we had to carve our electrons out of driftwood we'd find.  In
> the winter.  Uphill.  Both ways.
>
>
>> You were lucky. We lived for three months in a brown paper bag in a
>> septic tank. We used to have to get up at six o'clock in the morning,
>> clean the bag, eat a crust of stale bread, go to work down mill for
>> fourteen hours a day week in-week out. When we got home, our Dad would
>> thrash us to sleep with his belt!
>
> You got to work at a mill?  Lucky!  I got sent back to work in the
> acid-mines for my daily crust of stale bread... which not even the birds
> would eat.
>

Luxury. We used to have to get out of the lake at three o'clock in the
morning, clean the lake, eat a handful of hot gravel, go to work at the
mill every day for tuppence a month, come home, and Dad would beat us
around the head and neck with a broken bottle, if we were LUCKY!

--
Stefan
Reply | Threaded
Open this post in threaded view
|

Re: what is the origin

Jean-Rene David-2
In reply to this post by Gene Kwiecinski
* Gene Kwiecinski <[hidden email]>:
> I insert at the very beginning of a line

Not to be nitpicking, but this is ambiguous.

                                                        *I*
I Insert text before the first non-blank in the line
                        [count] times.

                                                        *gI*
gI Insert text in column 1 [count] times.  {not in Vi}

:h I
:h gI

--
JR
12