Currently, langmap applies in some limited fashion to the right side of
mappings. For example, the following from normal mode will delete until the end
of a line:
:set langmap=xd
:nnoremap z x
z$
Strangely this doesn't apply to all cases transparently, for example, the
following might be expected to delete a single line, but in fact it just blinks
the cursor:
:set langmap=xd
:nnoremap z x
zz
This is all a bit wacky, since it follows that if someone has a binding
(especially a noremap binding) they want the right side to execute as if in a
pristine environment. For example, if someone has made a mapping, ":nnoremap
<leader>d yyp" they presumably want a binding to duplicate a line -- not, say
undo twice and delete a character because they have "yu,px" in their langmap.
This is all a bit weird but manageable if you are in control of all your
mappings. What it really breaks is plugins. For example, a common pattern is to
have two levels of mappings: one containing a bunch of mappings prefixed with
<Plug> that are always installed, and another set that is conditionally
installed with some convenient defaults, often short patterns containing
<leader>. For example, excerpted from tpope's vim-surround plugin[1]:
nnoremap <silent> <Plug>Dsurround :<C-U>call
<SID>dosurround(<SID>inputtarget())<CR>
nmap ds <Plug>Dsurround
This is totally non-functional if any of the characters in "Dsurround" is
included in langmap, as they will get translated on the right side of the 'ds'
mapping. It's especially weird when people have insert mappings. For example,
ervandew's SuperTab[2] ships with the following mappings:
imap <script> <Plug>SuperTabForward <c-r>=<SID>SuperTab('n')<cr>
exec 'imap ' . g:SuperTabMappingForward . ' <Plug>SuperTabForward'
If you have a langmap affecting any of the characters in 'SuperTabForward' then
hitting tab in insert mode fails noisily with the bizarre behavior of inserting
the string "<Plug>SuperTabForward" into the document at the current position.
In short, it seems that langmap is really broken for mappings. I can't see any
reason why the right side of mappings should be translated at all.
Best,
Alex Ogier
[1] https://github.com/tpope/vim-surround/blob/master/plugin/surround.vim
[2] https://github.com/ervandew/supertab/blob/master/plugin/supertab.vim
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php