I often use something like :80
to quickly go to a line (80 for example).
I'm in a unique situation where I want to go to column 80, to see if lines are too long in files.
Any quick way to do this in vim?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityI often use something like :80
to quickly go to a line (80 for example).
I'm in a unique situation where I want to go to column 80, to see if lines are too long in files.
Any quick way to do this in vim?
Just type 80|
-> :h |
This is perfect for interactive mode. When scripting, there are other ways.
There is also a function to go to a specific line and column:
:call cursor(row, col)
colorcolumn
option useful.:set cc=80
will highlight the 80th column. You might also be able to automatically reformat everything to under 80 columns withgq
. Settingtextwidth
will automatically wrap lines as you type. Not necessarily useful now, but possibly useful in the future. – 8bittree Jul 7 '17 at 16:50