0

I set the following on my ~/.vimrc:

set langmap=qd,QD

However, q does not work since I set the following (so q just moves the cursor to left):

noremap d h
noremap h gj
noremap t gk
noremap n l

So I set them to langmap as well:

set langmap=qd,QD,dh,hj,tk,nl,ln,LN

However, when I type in h, it inserts a line, since I also set the following:

nnoremap j o<Esc>k

To recap, I want to set the q to d, which then makes noremap d h not working, so I added it to langmap as well, but it then becomes incompatible with other remap settings.

So is it possible to set the langmap as well as noremap, without the keys being set recursively?

I use Dvorak so I want to set it like the above.

1

As I mentioned in my answer to your original question on this topic AND in an associated comment to you (!!), the help for 'langmap' has advice for handling interference from :map mappings. Specifically, it suggests resetting of 'langremap'. When that is off...

...setting 'langmap' does not apply to characters resulting from a mapping. This basically means, if you noticed that setting 'langmap' disables some of your mappings, try resetting this option. This option defaults to on for backwards compatibility. Set it off if that works for you to avoid mappings to break.

I applied your settings and reset 'langremap' and h no longer inserts a line.

Note, though, that this isn't a panacea for all potential conflicts. If you have a jumble of mappings containing the same keys there may be other problems. You'll need to be judicious in what you decide to map. (And, of course, always use :noremap and friends instead of :map.)

  • Sorry, I thought a mod deleted all of our comments and so I took it to mean I should open a new question. But I later found out that it is a bug happening right now on Safari, that all the comments over SE are not shown. – Blaszard Feb 26 '18 at 5:56

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.