Reputation: 175
I'm using vim for some months ago and i'm still trying to customize my .vimrc to get the best performance while coding. In this case, I'm trying to override the defaults movements listed below:
$ (to go to the end of line)
0 (to go to the beginning of line)
I want to override the $
key to g_
that sends me to the last character in the line.
I also want to override 0
to ^
that sends me to the first character in the line.
Can you guys please help me to reach my aim?
Upvotes: 2
Views: 889
Reputation: 23697
nnoremap $ g_
nnoremap 0 ^
nnoremap
Normal mode non-recursive mapping, avoids nesting:h :map-commands
for inbuilt helpUpvotes: 1