You are not logged in.

#1 2010-04-13 15:30:59

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

"terminal" page up / page down

Hi everyone,

in vim i can use the PGUP/PGDWN keys to scroll down a whole page of text. I want the same behaviour in "terminal", which i use as my terminal emulator.
I know that i can use shift + pgup/pgdwn to do what i want but i don't want to have to press two buttons.

I thought .inputrc was the way to go, but there doesn't seem to be a variable for the desired action. I only checked "man readline" though, so maybe one of you knows the variable or another way to change the behaviour of keys in the terminal.
Thanks.

Regards,
demian

Last edited by demian (2010-04-13 15:32:38)


no place like /home
github

Offline

#2 2010-04-13 15:45:02

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: "terminal" page up / page down

I'm pretty sure it depends on what terminal you're using. In rxvt, I page up/down just fine. I think xterm behaves the same way.

Also, the way to scroll by pages or half pages without leaving the home row in vim is Ctrl+f/b (whole pages) and Ctrl+d/u (half pages).

Last edited by Berticus (2010-04-13 15:45:18)

Offline

#3 2010-04-13 15:51:56

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: "terminal" page up / page down

Thanks. I guess I'll have to make do with pressing two buttons. Or try urxvt again.


no place like /home
github

Offline

#4 2010-04-13 16:12:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: "terminal" page up / page down

What is the behavior of your terminal emulator when you press PGUP/PGDWN?

How about making your own shortcuts?

map < gT
map > gt

Now I can press just one button instead of two. Maybe you can make the application (be it vim or terminal) behave the way you want it by reconfiguring it?

Offline

#5 2010-04-13 16:17:23

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: "terminal" page up / page down

Beware though, that most applications use pgup/pgdown themselves (mc, weechat, etc.) and if you map those to the terminal they wouldn't work for the applications.


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#6 2010-04-13 16:37:30

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: "terminal" page up / page down

The default behaviour is defined in .inputrc:
"\e[5~": beginning-of-history
"\e[6~": end-of-history

For now, i can live with pressing two buttons. I just hoped there was an easy solution i didn't see. I'll look into urxvt oder maybe other terminal emulators soon.


no place like /home
github

Offline

#7 2010-04-14 12:26:42

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: "terminal" page up / page down

demian wrote:

The default behaviour is defined in .inputrc:
"\e[5~": beginning-of-history
"\e[6~": end-of-history

For now, i can live with pressing two buttons. I just hoped there was an easy solution i didn't see. I'll look into urxvt oder maybe other terminal emulators soon.

That .inputrc is something else. It doesn't scroll the screen, but just gives you the earliest/latest command you typed repeated at the current input line.

If you did manage to map pgup/pgdn, it would affect other non-terminal programs too, as someone said. Even if you worked around that, then your terminal would be catching pgup/pgdn so then vim and less and so on would never see them. So you'd have to use a different mapping for inside vim and less. This is the reason there are different bindings (shift-pgup, pgup) in place in the first place.

Now perhaps you could have a wrapper around vim etc. that removed whatever bindings you set up for the outside terminal. (And then if you dropped to a shell from the vim command line? reinstate them?...)

Offline

Board footer

Powered by FluxBB