How to jump directly to a column number in Vim
Sometimes for debugging purposes I have to do the exciting job of wading through minified javascript code. The lines are upto 600 columns wide. The exception reporting library is kind enough to provide me the exact crash coordinates in the form of line number and column number. However I can't find a way to directly jump to the column number, even though I can jump to the line so easily.
How can I do it?
Solution 1:
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
Solution 2:
You can use the cursor
function. For example, to jump to column 25 of line 15, you can use :call cursor(15,25)
.
Solution 3:
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