This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/onramp-to-vim-motions-and-moving
to go to the beginning of a line, I often use
^
however this is kind of hard to reach on a Querty keyboard. Does anyone have a good remapping for this key?
greetings and thanks,
Anthony
I just saw the video on vimrc configurqtion in the âOnramp to Vimâ course.
there Chris show the mapping for going to the beginning of line:
nmap 0 ^
just what I was looking for. Thanks Chris and Ben, this âOnramp to Vimâ tutorial is great!
greetings,
Anthony
This is a great example of why I love raiding other folksâ vim setups. Even if youâre only borrowing a tiny fraction of the shortcuts and strategies other vimmers are using, just seeing whatâs painful for other people helps you reframe whether youâre unnecessarily suffering through a less than ideal way of accomplishing something we probably do scores of times every day.
I recently saw a guy on Stack Overflow who mentioned that he does 0 w. Same number of keystrokes as ^, but easier to reach.
@wakelank, thatâs an interesting motion. I think thereâs an advantage to using ^
for things like deleting, etc, as some operations such as c
or d
with the ^
motion have a very different behavior than if you used them with 0w
.
If you had this line, where *
is the location of my cursor and the line is indented several spaces from the left side:
The quick* brown fox jumped over the lazy dog
And you wanted to change that sentence to have the same indentation but begin with The slow
from the current cursor location, you could type c^The slow<CR>
, but if you used c0w
, youâd have to begin your next typing by replacing the spaces that you just lost.
Hey, thanks for this vid again. I noticed when you searched, it vim highlighted all matches in a nice pink-ish text. If I turn on the vim highlight on search, it highlights it in a very hard to read (and quite distasteful, I might add, neon background ) What config did you do to get the nice pink-ish text? And if it is covered in a later video, you can just direct me there as always. Thanks.
Hey @thedanotto, sounds like this is a colorscheme issue, rather than a more general setting. You might want to try a different colorscheme (I use jellybeans).
Also, I cover some basic search settings in the Art of Vim if you want to check those out.
Thanks for that. jellybeans is awesome now that Iâve tried it.