14

In VI, I know that if you do

:some_number

and hit enter, you will jump to the line specified by "some_number". Is there an equivalent for jumping to a specific character in a single line?

Basically, I have a large csv and there is some characters that are breaking the parser; so I have to debug it.

I'm getting an error message that basically says "unexpected character on line XXX character YYY".

I know how to get to XXX but how do I get to YYY?

27

I'm not 100% sure of the meaning of the question, but if (for example) you want to find the next 'a' on a line, you'd type 'fa' (in command mode). That finds the next 'a' to the right. 'Fa' would find the next 'a' to the left.

The other way I can interpret your questions is that you want the cursor on a particular column. number| puts the curson on column number in the line the cursor already appears on.

  • I meant the latter. I've updated my question to clarify. – Dave Sep 21 '11 at 15:04
  • 7
    Also useful: t/T to go to the character before the given character, and ; to repeat the previous t/T/f/F. – Edd Steel Sep 21 '11 at 17:19
  • 6
    And , to go in the opposite direction using the same previous letter. – Ben Jackson Sep 21 '11 at 19:47
  • sry, but the answer is not clear, while the question is. Please tell in details what I have to type exaclty if I am sitting in the line of interest to jump on the specific char number in line. – buddy Nov 5 '18 at 10:07
  • The number, then the | symbol. – Jeff Schaller Nov 5 '18 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.