If we are in the vim editor, then simply do this, “Press the ENTER key, write the Line number, and press Shift+ g”: Again the output is the same.
If you want to show the current column of cursor, then type :echo col('. ').
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.
The |
command does what you want, as in 30| will take you to column 30.
bar
| To screen column [count] in the current line.
exclusive motion. Ceci n'est pas une pipe.
http://vimdoc.sourceforge.net/htmldoc/motion.html#bar
You can use the cursor
function. For example, to jump to column 25 of line 15, you can use :call cursor(15,25)
.
An alternative answer that works for me on Mac OS is to use the command that moves the cursor to the right (i.e. l
). So if your cursor is on the first column, and you want to put the cursor at column 50 of your current line, use the command:
49l
80| takes you to the 80th column - if your line has that many columns, that is, and from anywhere in the current line.
also: this is a pipe sign, not the lowercase letter 'L'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With