vim基础知识(二)移动和快速移动
------------恢复内容开始------------
w: move by word 一个单词一个单词的跳 跳到单词第一个字符
b: back,move backwards word by word 往回跳一个单词,往回一个单词第一个字符
Wto move word by WORDBto move backwards WORD by WORD
e: 跳到单词的末尾
ge:跳到前一个单词的末尾
Eis likeebut operates on WORDS(就是说按逗号作为一个单词 而不是空格)gEis likegebut operates on WORDS
精确跳转
f: f加字符,跳到当前行后的字符
F: f加字符,跳到当前行前的字符
使用分号;重复上一次的移动!!!
水平移动
0: Moves to the first character of a line^: Moves to the first non-blank character of a line$: Moves to the end of a lineg_: Moves to the non-blank character at the end of a line
垂直移动
Starting from k and j, we move on to a faster way of maneuvering vertically with:
}jumps entire paragraphs downwards{similarly but upwardsCTRL-Dlets you move down half a page by scrolling the pageCTRL-Ulets you move up half a page also by scrollingjk
注意别和 u以及shift+u混淆(U)
以及D和d
@content vim edit the body
具有语义的移动
In addition to the previous motions which don’t really take into account the meaning of your code, Vim offers additional bindings that take your code semantics into consideration:
- Use
gdto go to definition of whatever is under your cursor. - Use
gfto go to a file in an import.
回到上次编辑或者查看的位置
ctrl+o
ctrl + o:返回刚刚查看的内容
ctrl + ]:查看定义
gi重新编辑刚刚编辑的内容
核心,漂亮的移动
- Type
ggto go to the top of the file. - Use
{line}ggto go to a specific line.具体行数 nice - Use
Gto go to the end of the file.
------------恢复内容结束------------
本文来自博客园,作者:勒勒乐了,转载请注明原文链接:https://www.cnblogs.com/matytan/articles/15846144.html

浙公网安备 33010602011771号