#print Basic Movement - Screen Movement As you might have noticed, while the arrow keys are handy for moving short distances, they're a little slow for moving all the way across the screen, for example. Vi has many ways of moving greater distances, some of which will be covered in much later lessons. For now, though, let's see how to move to the extremes of the screen. Horizontally - Moving to the ends of a line is accomplished with the '$' key (to go to the end) and the '^' key (to go to the beginning). Un- like most of the vi commands, there doesn't appear to be any mnemonic reason for choosing those characters, so you just have to remember them. Vertically - There are three commands for positioning the cursor at the top, middle and bottom of the screen, namely H (for the 'high' top), M (for the middle) and L (for the 'low' bottom). Type 'ready' now and I'll put you into vi now to practice these movement commands. #user #create Movement2 The beginning and end of lines are reached with ^ and $. The top, middle, and bottom of the screen are reached with H, M, and L. Note that the ^ command actually puts the cursor on the first non-blank character of a line, not the true beginning. While this is usually what you want, vi also provides the 0 (that's a zero) command, which places the cursor on the very first character of the line, be it blank or otherwise. The rest of this page is here to give you enough text on the screen to make using the H, M, and L commands worthwhile. You won't be held responsible for the material covered here. A little-known feature of the H and L commands is that you can precede them with a number to move to cursor to that many lines away from the top or bottom. For example, the command 5L will move the cursor to the fifth line from the bottom of the screen. Similarly, 4H will move it to the fourth line from the top. Try it! Remember to type :q to get out of vi when you're ready to go on. This is the last time you'll be reminded, so you'd better have that command, at least, truly memorized. # vi Movement2 #next 2.3 10