Go to n-th symbol in line

后端 未结 3 2006
栀梦
栀梦 2021-01-30 08:10

How to move cursor to the n-th symbol from the left in Vim?

One of the solutions I see is press 0n, it will move to the n+1 position. Is

3条回答
  •  鱼传尺愫
    2021-01-30 08:35

    EDIT: misread your question.

    you can move forward to a particular symbol by typing f followed by the symbol in question:

    if you want to move to the third $, you'd type:

    3f$
    

    in order to go backwards, you use capital "F"

    F$
    

    to get to the end of the line first, you use "$"

    so your keystrokes for finding the third $ from the end of a line is:

    $3F$
    

    i like to keep something like this handy when using Vim:
    http://www.lagmonster.org/docs/vi.html

提交回复
热议问题