0

Suppose I have a wrapped line like this

enter image description here

with the cursor positioned just before the AND (&).
Is there an option to move the cursor just before the OR (|) pressing the <Down> key ?

This should be possible with a function, but an option would be better, of course.

EDIT: The editor hid the <Down> text word (now I edited). My intention is not to jump to a specific character but to a specific position. In other words, treating a single line as it were two line

  • t| to jump to just before the next | and ; to repeat the last t command. See :h t and :h ; for more info. – klaus Mar 30 at 18:37
  • Please post actual text and not screenshots in the future. Screenshots are difficult for a number of reasons, and actual text can be copy pasted. Screenshots are usually permissible when they clarify a post (ie something in a colorscheme looks weird), but here I dont think it adds value that a block of text couldnt have done. The fact that the line wraps is almost irrelevant. – D. Ben Knoble Mar 30 at 18:49
  • The editor hid the <Down> text word (now I edited). My intention is not to jump to a specific character but to a specific position. In other words, treating a single line as it were two line. – simo-zz Mar 31 at 10:23
  • The solution has beeen already threated here: stackoverflow.com/questions/1833250/… – simo-zz Mar 31 at 10:57
2

See :h t, :h T, :h f, :h F and :h ;

For a brief overview:

  • You can jump to the next {char} with f{char} or jump to previous {char} with F{char}
  • You can jump just before the next {char} with t{char} and jump just after the previous {char} with T{char}
  • You can repeat last f, F, t or T with ;

All of the above commands take [counts] as an argument. So, you can perform [count]f{char} to go to the [count]-th next {char} and similar for all f, F, t, T and ;

Edit

The OP edited his question and his actual requirement was to move up and down virtual display lines. You can do that with :h gj and :h gk

  • My first thoughts exactly. This is I never remapped ; to : or used , as my leader like so many—its too useful. – D. Ben Knoble Mar 30 at 18:47
  • 2
    I didn't think anyone would remap ;. But I used , as leader early on because somehow I only knew about ; and not ,! But now I use <Space> as my leader. – klaus Mar 30 at 18:55

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.