Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go to n-th symbol in line

Tags:

vim

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

One of the solutions I see is press 0n<right-arrow>, it will move to the n+1 position. Is there any more natural way to do it?

like image 906
Nutel Avatar asked Dec 17 '10 01:12

Nutel


People also ask

How do you enter insert mode and go to the beginning of the line?

Esc + i to exit insert mode and enter it again, effectively going to the beginning of line.

How do I jump to a specific line in vi?

If you're already in vi, you can use the goto command. To do this, press Esc , type the line number, and then press Shift-g . If you press Esc and then Shift-g without specifying a line number, it will take you to the last line in the file.

How do I jump to the end of a line in Vim?

We may need to end the last line from anywhere in the file. Even the cursor has located the start of the file you can move the end of the last line with the following steps. Press the ESC key. Press G to move the last line and press $ to move the end of the line.


1 Answers

The pipe '|' character may be what you want:

To go to 25th column in a line in normal mode press 25|

To go to 37th column in a line in normal mode press 37|

and so on. . .

like image 72
Herbert Sitz Avatar answered Oct 01 '22 07:10

Herbert Sitz