#print Basic Movement - File movements Now you'd probably like to be able to move around in files which are longer than one page, eh? You could probably look through the whole thing using '-' and return to go up and down a line at a time, but... The ^D and ^U commands are used for moving by half-pages. (Remember, ^D means hitting the D key while holding down the 'Control' button...). ^D will move the screen down a half-page in the file. ^U, oddly enough, does the reverse, moving you up a half-page. If you're in more of a hurry, try ^F and ^B, which move you forward and backward a full page at a time, respectively. If you know exactly which line you want to go to (i.e. you know its line number) then the 'G' command was made for you. You just type the line number followed by a 'G' and vi will 'go' to that line. If you type 'G' without a preceding number, vi will go to the end of the file. Here's a little trick: if you want to see line numbers in vi type ':set nu'. Type 'ready' now to get practice in moving in larger files. #user #create Movement3 The commands for moving around in larger files are as follows: ^D - Scroll forward (down) a half-screen ^U - Scroll backward (up) a half-screen ^F - Page forward one full screen ^B - Page backward one full screen G - Go to a particular line. 56G goes to line 56. G goes to the end of the file. ----------------------------- The text which follows is intended to serve as a practice file in this and future lessons. You'll get a new copy of it each time, so don't worry about accidentally messing it up. ----------------------------- # cat /usr/share/learn/vi/longtext >> Movement3 vi Movement3 #next 2.4 10