1

How do I move the cursor to the next/previous number?

Ctrl-x and Ctrl-a can't be used since I have :set nrformats+=alpha.

0

1 Answer 1

3

Next number: /[0-9] or /\d

Previous number: ?[0-9] or ?\d

For non-decimal numbers, you can also use these equivalences:

\d : [0-9]        -> decimal digit
\x : [0-9A-Fa-f]  -> hex digit
\o : [0-7]        -> octal digit
3
  • 3
    Slightly faster, perhaps, and more flexible: /\d and ?\d
    – D. Ben Knoble
    Commented Jun 29, 2021 at 18:01
  • 1
    Significantly slower, indubitably, and less flexible ;) /[[:digit:]] and ?[[:digit:]]
    – B Layer
    Commented Jun 30, 2021 at 0:34
  • 1
    @D.BenKnoble added, thanks
    – Hobber
    Commented Jun 30, 2021 at 7:53

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