📄 l2.2
字号:
#print Basic Movement - Screen Movement As you might have noticed, while the arrow keys are handy for movingshort distances, they're a little slow for moving all the way across thescreen, for example. Vi has many ways of moving greater distances, someof which will be covered in much later lessons. For now, though, let'ssee 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 mnemonicreason for choosing those characters, so you just have to remember them. Vertically - There are three commands for positioning the cursor at thetop, middle and bottom of the screen, namely H (for the 'high' top), M (forthe middle) and L (for the 'low' bottom). Type 'ready' now and I'll put you into vi now to practice thesemovement 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-blankcharacter of a line, not the true beginning. While this is usually whatyou 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 makeusing the H, M, and L commands worthwhile. You won't be held responsible forthe material covered here. A little-known feature of the H and L commands is that you can precedethem with a number to move to cursor to that many lines away from the topor bottom. For example, the command 5L will move the cursor to the fifthline from the bottom of the screen. Similarly, 4H will move it to the fourthline from the top. Try it! Remember to type :q to get out of vi when you're ready to go on. Thisis the last time you'll be reminded, so you'd better have that command, atleast, truly memorized.#vi Movement2#next2.3 10
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -