4

I am new to Vim and I am trying to remap the four (arrow) navigation keys hjkl one step to the right on the keyboard to get

  • j down
  • k up
  • l left
  • ; right

I am following the recommendations given in this answer[1], and I am using a norwegian keyboard where the ; key is replaced by an ø key.

In my ~/.vimrc I have:

nnoremap l h
nnoremap ø l

I have installed the repmo plugin, and I suspect that is the cause of the problems I have with this.

So the problem is that the l key does not map to h (left); instead, when I press l, the cursor moves to the right. To debug, I tried to print out the actual mappings:

  • :map h gives:

    nx h           & <SNR>9_repmo('h','l')<CR>
    
  • :map l gives:

    n  l             <SNR>9_lastkey
    x  l             <SNR>9_lastkey
    

Footnotes:

[1] Answer to stackoverflow.com question: Vim users, where do you rest your right hand?

  • 2
    I would start by checking whether it is repmo or not with --noplugin. It could be an encoding issue in nn but that is less likely. – grochmal Jun 24 '16 at 0:33
  • @grochmal Yes it works fine when using --noplugin. Does it mean that the repmo plugin is broken, or does it mean that I should not remap l key to h key? – Håkon Hægland Jun 24 '16 at 6:24
  • Hard to say. You could try contacting the author, and see if he knows why this is happening or has any plans to update it in the future. Or you could try browsing the plugin's code to see if you could fix it yourself. But until one of those methods shows a result, I think your options are either to not use the plugin, or not use the mapping. – Tumbler41 Jun 24 '16 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.