Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapping keys using Vim

Tags:

vim

I want to switch to using vim but I have one major requirement for any editor:

I need to map the ` key to the = key (as I've made the equals key the backspace key as the real backspace doesn't work (long story haha))

I can't seem to find anyway of doing this in vim (baring in mind I'm quite a noob at it.) There are a lot of references to :map but I can't get that to work how I want. Any help for a newbie?

like image 887
andy Avatar asked Aug 14 '26 05:08

andy


2 Answers

You just put this into your vimrc:

nnoremap ` =
xnoremap ` =
inoremap ` = 
cnoremap ` =
onoremap ` =

which will remap ` to = in normal, visual, insert, command-line and operator-pending modes resp.

See :help map for more information.

Note that it would probably better to remap ' than `, the latter being more useful (go to mark, keeping column number).

like image 144
Benoit Avatar answered Aug 19 '26 03:08

Benoit


You can try this key-mapping:

:inoremap ` =

I also find it useful to use Ctrl-H as backspace key in insert mode.

like image 41
kev Avatar answered Aug 19 '26 03:08

kev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!