I'm new to Vim and am curious as to why $
would be used to go to the end of the line. So, for example, 0
taking me to the beginning makes at least some sort of sense (first number on keyboard goes to first letter of line---understandable).
Is there any logic behind $
or is it just totally arbitrary?
I was thinking $
tart, until I remember it took me to the end!
Thanks!
At some point it was arbitrary, but for decades $
has been the symbol to indicate the end of a string in a regular expression. vim
is honoring historical precedent and making the keystroke very intuitive to people familiar with regular expression syntax.
Dollar represents the end of line as it is used in Regex also. I think its arbitrary.
You can also use A to move to the end of the line and switch to editing mode
if you know some regular expression, you would know that in regex, $
means the the end of line. I guess, vi/vim took that idea.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With