VIM关于移动的命令有哪些?
在当前行里面有效的移动光标
* fx:移动光标到当前行的下一个 x 处。很明显,x 可以是任意一个字母,而且你可以使用 ; 来重复你的上一个 f 命令。
* tx:和上面的命令类似,但是是移动到 x 的左边一个位置。(这真的很有用)
* Fx:和 fx 类似,不过是往回找。
* w:光标往前移动一个词。
程序员都应该知道的130个vim命令是什么?
??txtin new window
11、分屏显示:e filenameEditfilenamein current window:split filenameSplit the window and openfilenamectrl-w up arrowPuts cursor in top windowctrl-w ctrl-wPuts cursor in next windowctrl-w_Maximize current window verticallyctrl-w|Maximize current window horizontallyctrl-w=Gives the same size to all windows10 ctrl-w+Add 10 lines to current window:vsplit fileSplit window vertically:sview fileSame as:splitin readonly mode:hideClose current window:nlyClose all windows, excepted current:b 2Open #2 in this window
12、自动完成Ctrl+n Ctrl+p (in insert mode)Complete wordCtrl+x Ctrl+lComplete line:set dictionary=dictDefinedictas a dictionnaryCtrl+x Ctrl+kComplete with dictionnaryMarksm {a-z}Marks current position as{a-z}’ {a-z}Move to position{a-z}”Move to previous position/
13、缩写:ab mail [emailprotected]Definemailas abbreviation of[emailprotected]
14、文本缩进:set autoindentTurn on auto-indent:set smartindentTurn on intelligent auto-indent:set shiftwidth=4Defines 4 spaces as indent sizectrl-t, ctrl-dIndent/un-indent in insert modeIndentUn-indent=%Indent the code between parenthesis1GVG=Indent the whole file/
15、语法高亮:syntax onTurn on syntax highlighting:syntax offTurn off syntax highlighting:set syntax=perlForce syntax highlighting
如若转载,请注明出处:https://www.universum.com.cn/15444.html