开发者

vim remapping the hjkl

开发者 https://www.devze.com 2023-01-04 08:56 出处:网络
I am trying to map the letter hjkl to jkl in my .vimrc file so that I can have my fingers the way they always are on the keyboard, while writing in vim.

I am trying to map the letter hjkl to jkl in my .vimrc file so that I can have my fingers the way they always are on the keyboard, while writing in vim.

The problem is that as I map k to l, it jumps into the l to ;. so k becomes the same as ;. The same off course happens to a开发者_如何学运维ll of them.

So all the keys become one because they copy through one another.

How can I prevent that?


use noremap:

noremap ; l
noremap l k
noremap k j
noremap j h


Check out :help noremap. This will prevent maps from recursively being mapped.


As a follow-up to @Lie Ryan's comment, I've written this Answer on a similar question

Basically, you might want to consider keeping:

j & k = up & down

since those are so primary

But then also consider:

l & ; = left & right

0

精彩评论

暂无评论...
验证码 换一张
取 消