Page up in Terminal


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Page up in Terminal
# 1  
Old 02-03-2011
Page up in Terminal

Hi all--

I'm using a SunOS machine at my campus and my pageup and pagedown keys are unresponsive inside of vi.

I'm not too thrilled about using ctrl+f and ctrl+b to do this operation, so I'm wondering how I might remap these keys to scroll up in down within the terminal as opposed to scrolling the actual terminal up and down.

The same occurs with the home and end keys, and I am looking to remap those as well.

Any thoughts?

Last edited by Prodiga1; 02-03-2011 at 06:26 PM..
# 2  
Old 02-03-2011
Hi,

I don't work with SunOs, but what about mapping them?? Is it possible?? (Not tested)
(Inside Vi)
Code:
:map <PageUp> <C-b>
:map <PageDown> <C-f>

Use other keys if PageUp and PageDown cannot be used, like:
Code:
:map ,b <C-b>
:map ,f <C-f>

I hope it helps.

Regards,
Birei
# 3  
Old 02-03-2011
You will need to create a ".exrc" file in your home directory. The "vi" editor looks for this file to to map the keyboard to "vi" functions such as "page up", "page down", "insert" etc..
Please post your Operating System version (blotting anything private) because the term "SUNOS" covers umpteen years of Sun Operating Systems. Please post your terminal type. I may not be able to provide a suitable .exrc (unless I have had your SunOS version in the past) but there are many Sun unix users on this board.
Code:
uname -a
echo $TERM

# 4  
Old 02-03-2011
SunOS marge 5.10 Generic_142910-17 i86pc i386 i86pc Solaris
xterm
# 5  
Old 02-03-2011
This can be a bit of trial-and-error.

This in a .exrc file worked for me on Sunos with vt220 emulation and X-Windows. I have used "cat -v" to display the contents of the file because it contains control codes.
For example where we have "^[" this is actually the Escape character. Where we have "^B" this is the control code ctrl/B.
Notice the mapping to k,j,h,l - the basic "vi" cursor movement keys.
We are mapping what the keyboard generates to what "vi" expects.
The real control code needs to be in the .exrc file - not the ascii characters ^key.

Code:
 Within the .exrc file

map ^[[A k
map ^[[B j
map ^[[D h
map ^[[C l
map ^[[2~ i
map ^[[5~ ^B
map ^[[6~ ^F


Last edited by methyl; 02-03-2011 at 06:59 PM..
# 6  
Old 02-03-2011
That specific .exrc text didn't work in this case.

How might I determine the character code for these keys?

I know ctrl+v + key usually works, but it isn't for reasons I do not know
# 7  
Old 02-03-2011
What I do is use "vi" and ctrl/V to generate the escape sequence.

vi .exrc
^V <then press the control key concerned>, then the rest of the escape sequence, then space character, then press the key vi expects using ^V if necessary.

Last edited by methyl; 02-03-2011 at 08:15 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print Terminal Output Exactly how it Appears in the Terminal to a New Text File

Hello All, I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly. Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies

2. Shell Programming and Scripting

Cannot get terminal application to launch with a graphical launcher when successful in terminal

I have been having an extremely annoying problem. For the record, I am relatively new at this. I've only been working with unix-based OS's for roughly two years, mostly Xubuntu and some Kali. I am pretty familiar with the BASH language, as that's the default shell for debian. Now, I've made this... (16 Replies)
Discussion started by: Huitzilopochtli
16 Replies

3. Shell Programming and Scripting

script for adding page number before page breaks

Hi, If there is an expert that can help: I have many txt files that are produced from pdftotext that include page breaks the page breaks seem to be unix style hex 0C. I want to add page numbers before each page break as in : Page XXXX Regards antman (9 Replies)
Discussion started by: antman
9 Replies

4. Shell Programming and Scripting

Print multiple copies page by page using lp command

Hi I have a pdf file that is being generated using the rwrun command in the shell script. I then have the lp command in the shell script to print the same pdf file. Suppose there are 4 pages in the pdf file , I need to print 2 copies of the first page, 2 copies of the second page , then 2... (7 Replies)
Discussion started by: megha2525
7 Replies

5. Web Development

Page load time- local page

Hi Is there a way to calculate the page load time, I am trying to calculate the load time of a page locally. I found tools to do this over http or https but none that work locally. Any ideas? Thanks. (4 Replies)
Discussion started by: jamie_123
4 Replies

6. UNIX for Dummies Questions & Answers

display command output page per page

Good afternoon, I wonder how i could use unix commands to ease the reading of long command result output ? like the "php -i" or any other command that returns a long answer. I could not find the right terms to Google it or search the forum. Therefore I bother you with this question. ... (3 Replies)
Discussion started by: Mat_k
3 Replies

7. OS X (Apple)

Changing OSX Terminal Man Page Colors

For a long time, when I type man anything on my Mac, both the manpage header fonts and the background was black, so I had to use my mouse to highlight the manpage output to read it. It was really annoying. The problem was the same both locally or using the terminal and going ssh somewhere. ... (1 Reply)
Discussion started by: Neo
1 Replies

8. Solaris

High Page In and Executable page In

Hi, Currently I'm experience very high page ins on my system running on solaris 10. From vmstat, the page ins figure is very high, further drill down shows the page ins are from file system and occassional spike in executable page ins. Details as follow: oracle@perch:/files>> vmstat 5... (9 Replies)
Discussion started by: srage
9 Replies

9. Shell Programming and Scripting

lpr- how to print from page to page

hi all i have file_1 which contains 66 pages and i want to print only page 1 to 3 i try to write like this lp -d name_of_printer file_1 -P 1-7 this command does not work any ideas ? (4 Replies)
Discussion started by: naamas03
4 Replies

10. UNIX for Advanced & Expert Users

connecting to unix through hyper terminal - as a dumb terminal

I just changed from windows NT to XP and I am no longer able to connect to my unix system. I used to use hyper terminal -- which acts as dumb terminal to my main frame unix system. I think one of the options used to be "direct to comX". This option isn't listed now. I use a serial port and the... (2 Replies)
Discussion started by: michelle
2 Replies
Login or Register to Ask a Question