Vim langmap breaks plugin (bépo)
Asked Answered
D

1

7

I am using a bépo keymap (http://bepo.fr) and seeking the perfect vim mapping.

So far I used a long list of noremap, but for many binding (for exemple, the motion aw or Ctrl+r), the first keystroke is well remaped but not the others, I reckon it's the expected behaviour, but then this is not what I need.

Ideally I would have my keyboard totally remaped in a higher level (before the map commands) except when typing text (in insertion mode and when typing a substitution for exemple). What I'm looking for seems to be langmap, but I have problems using it.

I added this langmap to my .vimrc, It seems perfect but it broke some of my plugins. SuperTab now insert <Plug>SuperTabForward when pressing Tab in insertion mode, I have t<SNR>24_SelectCompletion(1) when pressing enter.

Does someone know how to fix this langmap issue or a better way to remap my keyboard?

Dynamism answered 16/9, 2012 at 21:17 Comment(5)
Similar question with answer : #7889580Ares
@XavierT. This is the same problem indeed, but the only "solution" there is a workaround that won't work for me since I remap every key. In fact, I think langmap is more intended to be used for mapping things like Russian characters, I'd accept an answer saying "langmap is not intended for this usage" but this is never the answer given to that problem. Meanwhile, I still have my hundred noremap :DDynamism
Remapping the whole keyboard is a stupid idea: b is not b because of any physical property of the b key; it is b because b is the first letter of beginning. And the same goes for almost every command. You are not only forcing yourself to map dozens and dozens of letters to other letters, completely loosing their mnemonic nature but you are also fighting against Vim with dirty hacks that don't even work. b is b, no matter where it is on your keyboard.Togs
This is not what is happening. When I type for example the e motion (which is the p key in bépo), I think "e", not "p", and "e" is still what is printed on my keyboard. But the real reason for this is that I really want to use the hjkl keys to move around, in bépo that would be like using (respectively) .pbo which is unusable. But if a remap that, i use the ctsr keys, and then need to remap those keys. I could remap only the really problematic keys, but having just half of my keys remap seems like an even worse idea.Dynamism
I would consider this a bug and asked Bram to clarifyAdulation
A
4

This is a known bug, that has been discussed before. I have made a patch (see the thread starting here) and hopefully Bram will include this change soon.

Update 11/05/2014
This has been fixed by patch 7.4.502. Use the langnoremap option to fix this.

Adulation answered 16/10, 2014 at 6:4 Comment(13)
(Sorry for the late reaction). Thanks for starting a new thread and making a patch! I tested it, but I still get the supertab message inserted when I hit tab. I applied the patch, ran ./configure --prefix=$HOME/.local --with-vim-name=vim-test --with-features=huge then make and make install and tested on a C++ file with ~/.local/bin/vim-test. Did I do something wrong?Dynamism
I am not sure, which patch you used. The latest one introduced a 'langnoremap' option. which by default is off and you explicitly need to set it. BTW: If you used it and it works, please report back at that mentioned thread.Adulation
Er… sorry, I saw it, then forgot about it. There's evolution, now hitting tab inserts ` SuperTab('n')` (still instead of autocompletion). Yes, I'll post on the mailing list when it works!Dynamism
Can you find out, which of your langmap causes this? So far, I have not been able to replicate this.Adulation
I narrowed it down to remaping =: langmap==- inserts "SuperTab('n')" with or without set langnoremap.Dynamism
I see the problem. I'll look into fixing it and will post an updated patch thenAdulation
Seems to work! I'll use it tomorrow to see if there isn't some other corner cases I can find. I'll post on the thread then, but I can already accept your answer and give the bounty :). Thanks!Dynamism
The patched Vim does not work for me. For example, setting set langnoremap, nnoremap / r, set langmap=é/ does not work as expected when pressing <é> key.Whelk
@Alexey, please provide detailed steps at the vim-dev mailinglist I'll try to fix it. What's your Vim version, btw?Adulation
Ok, i'll do it, thanks. I have Vim 7.4.622. The steps are the ones i've mentioned above: i put these three commands in a file, execute it with :so %, and try if it works -- it does not.Whelk
Sorry, i was not clear: it does not work in a funny way: langmap itself works, it is nnoremap that is ignored if i try with é or ç, but works with a.Whelk
I've posted to vim_dev.Whelk
Thanks. I'll have a look later. Looks like issue 297 (code.google.com/p/vim/issues/detail?id=297)Adulation

© 2022 - 2024 — McMap. All rights reserved.