Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

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

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,
Old 05-10-2011, 03:46 AM   #2
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled

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>

Old 05-10-2011, 03:46 AM   #3
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-10-2011, 11:31 PM   #4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.3
Posts: 17,524

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


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 12:40 AM
web page editor for Linux fedora CZTY Linux - Software 7 07-02-2009 12:06 PM
Why can't I move a page ahead in the forum?? Bill_Hwy LQ Suggestions & Feedback 9 03-03-2008 06:18 PM
is ubuntu home page down or did they move? eridanaeon Linux - Newbie 4 10-04-2007 10:51 PM
move to last page bruse Linux - Newbie 2 07-15-2005 07:31 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:57 PM.

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