LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-10-2011, 03:50 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Rep: Reputation: 31
vi editor to move file page.


hi,
I have a file of 200 pages. I want to move my cursor page wise. Suppose I want to move my cursor from last page of the file to up three pages.
Is there any command to do it or I use "k" to move up?
thanks in advance,
garden
 
Old 05-10-2011, 04:46 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Hi,

what do you mean with "page", a "screenfull" can be moved by <CTRL><B> and <CTRL><F> backward (up) and forward (down).
You may also give the k (or j) command a number as an argument, 40k will move 40 lines up.

To your question: 3 pages up = 3<CTRL><B>

Markus
 
Old 05-10-2011, 04:46 AM   #3
baltho
Member
 
Registered: Aug 2004
Location: Adelaide, South Australia
Distribution: Ubuntu (Natty)
Posts: 38

Rep: Reputation: 18
A few options here, as always in the OSS world!

Simplest, if your pages are (say) 50 lines each, typing 50k will move you up a page. 150k up 3 pages, etc.

If the pages are separated by a new-page character (Ctrl-L from memory) you could search for that: / Ctrl-V Ctrl-L (use a ? instead of a / to search backwards)

Both of those could be mapped to function keys:
:map PgUp 50k
for instance. (Not sure about the "PgUp", you might need to refer to the manual for your particular version of vi...). Stick that command in a .vimrc file and it'll be permanent.

Hope this helps....
 
1 members found this post helpful.
Old 05-11-2011, 12:31 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
If the keybd mapping is correct, I think you should be able to use the cursor keys marked 'Page Up', 'Page Down' ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Vi editor How to move cursor to a specified line number. gardenair Linux - Newbie 4 12-07-2010 01:40 AM
web page editor for Linux fedora CZTY Linux - Software 7 07-02-2009 01:06 PM
Why can't I move a page ahead in the forum?? Bill_Hwy LQ Suggestions & Feedback 9 03-03-2008 07:18 PM
is ubuntu home page down or did they move? eridanaeon Linux - Newbie 4 10-04-2007 11:51 PM
move to last page bruse Linux - Newbie 2 07-15-2005 08:31 AM


All times are GMT -5. The time now is 10:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration