How do I move to end of line in Vim?

我知道如何在命令模式下四处走动,特别是跳到线条等。但是,跳到我目前所在线的最后的命令是什么?


Just the $ (dollar sign) key. You can use A to move to the end of the line and switch to editing mode (Append).

The opposite of A is I (Insert mode at beginning of line), as an aside.


As lots of people have said:

  • $ gets you to the end of the line
  • but also:

  • ^ or _ gets you to the first non-whitespace character in the line, and
  • 0 (zero) gets you to the beginning of the line incl. whitespace

  • $ moves to the last character on the line.
  • g _ goes to the last non-whitespace character.

  • g $ goes to the end of the screen line (when a buffer line is wrapped across multiple screen lines)

  • 链接地址: http://www.djcxy.com/p/1370.html

    上一篇: Vim清除上次搜索高亮显示

    下一篇: 如何在Vim中移动到行尾?