2

They both seem to move the cursor to the first non-blank character of the current line and I wonder what was the reason for duplicating this functionality

1 Answer 1

5

Hello and welcome to this site!

:help left-right-motions is your friend here.

The difference is that _ accepts a [count] before it, citing the manual:

_  <underscore>         [count] - 1 lines downward, on the first non-blank
                        character linewise.

while:

^                       To the first non-blank character of the line.
                        exclusive motion.

Obviously, _ by itself is equivalent to 1_, so the outcome is 0 lines downward, on the first non-blank character linewise, which means the current line (just like ^).

1
  • 2
    @lox You might also want to read this to get better at using Vim's documentation
    – statox
    Commented Sep 18, 2018 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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