vim基础知识(二)移动和快速移动

------------恢复内容开始------------

w: move by word 一个单词一个单词的跳 跳到单词第一个字符
b: back,move backwards word by word 往回跳一个单词,往回一个单词第一个字符
  • W to move word by WORD
  • B to move backwards WORD by WORD
e: 跳到单词的末尾
ge:跳到前一个单词的末尾
  • E is like e but operates on WORDS(就是说按逗号作为一个单词 而不是空格)
  • gE is like ge but 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 line
  • g_: 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 upwards
  • CTRL-D lets you move down half a page by scrolling the page
  • CTRL-U lets 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 gd to go to definition of whatever is under your cursor.
  • Use gf to go to a file in an import.

回到上次编辑或者查看的位置

ctrl+o 

ctrl + o:返回刚刚查看的内容
ctrl + ]:查看定义
gi重新编辑刚刚编辑的内容

核心,漂亮的移动

  • Type gg to go to the top of the file.
  • Use {line}gg to go to a specific line.具体行数 nice
  • Use G to go to the end of the file.
    ------------恢复内容结束------------
posted @ 2022-01-26 12:57  勒勒乐了  阅读(128)  评论(0)    收藏  举报