[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: a quick Q: how to back to the head in terminal



Camaleón wrote:
> And I'm feel obliged to thank you for that :-)

Glad it was useful and helpful.

> In fact, I first asked for a similar question in the Spanish mailing list 
> a month ago or so, but no one suggested these "keyboard combos" and of 
> course, I was neither aware of it.

They are not "keyboard combos" as I think of them.  They are editor
keys.  By default the emacs editor but optionally the vi editor.

> Bash manual provides "home/end" replacements

As I recall things (meaning I don't have a reference but as I recall
this) the home key went to the beginning of line and the end key went
to the end of line.  This was an MIT X Window System behavior.  But on
MS systems home went to the top of file and end to the bottom.  With
the many MS users overwhelming the number of Unix users the behavior
was inevitably changed to follow the MS behavior.  I am probably one
of the very few people left who haven't given in and always customize
home to be beginning of line and end to be end of line.

But if you want begining of file then the emacs keys are M-< and M->
for meta-< and meta-> or ESC-< and ESC-> with ESC used to simulate the
meta key.  If you want beginning of line and end of line then C-a and
C-e.

> but I also looked for "page up/page down" key combos because my
> netbook lacks for them.

Page up and page down are called scroll up and scroll down in the
emacs universe and by default would be C-v and M-v.  In vi those would
be control-d for down and control-b for backward.  Different editors
with different development histories and different use paradigms.  The
"war" between them has been legendary.  And quite a bit of fun too. :-)

In emacs the same 'v' key is a view key and the modifier of either
control or meta causes the view to scroll either up or down.

> While searching for a good way to mimic the
> keys, I also found -by pure chance- these combos:
> 
> ctrl-v = page up
> ctrl-b = page down

You mean the other way around.  You have those flipped.  But I know
what you mean.

As has been pointed out those are not in the shell but in less.
Because less is merging multiple different use models together in one
place.  It is meaning C-v to be emacs-like for forward but C-b to be
vi-like for backward.  But that merging is less program specific.  In
the bash shell and others those keys do different things.  But less is
trying to accommodate both users at the same time and so has both sets
of keys mostly active as much as is practical.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: