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
Asked
Active
Viewed 109 times
1 Answers
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 ^).
Daniele Santi
- 196
- 2
- 4
-
2@lox You might also want to read this to get better at using Vim's documentation – statox Sep 18 '18 at 10:14