How to move the cursor to a specific row and column?

:30 move my cursor to the beginning of line 30.

How can I tell Vim to place the cursor on row y, column x? Is this possible without the arrow buttons or h , j , k , l ?

I am running Vim version 7.3.429.

+45
vim
Aug 01 2018-12-12T00:
source share
3 answers

Try the number followed by the pipe to go to the specified column in this row.

80| should bring you to position 80 on this line.

EDIT: If you want to go to a specific position x, y, I'm not sure about that.

+81
Aug 01 2018-12-12T00:
source share

Not sure if this is more convenient, but you can directly call the cursor function:

 :cal cursor(30, 5) 

will go to row 30, column 5.

+61
Aug 01 2018-12-12T00:
source share

In command mode:

Enter the number followed by G (uppercase) to jump to this line number.
Example: 30G goes to line 30.
Example: G goes to the last line of the buffer.

Enter the number followed by | (pipe) to go to this column in the current row.
Example: 80 | goes to column 80.

So: 30G80 | goes to row 30, column 80.

+19
Sep 30 '14 at 11:05
source share



All Articles