Friday, November 20, 2015

Re: [Bulk] Question about language specific mappings

Am 19.11.2015 um 23:23 schrieb Dmitri Vereshchagin:
> More precisely question is about unmapping. I am using keymap to edit
> texts in Russian. In my vimrc I have
>
> set keymap=russian-jcukenwin
> set iminsert=0
> set imsearch=-1
>
> When langmap mappings are enabled it translates `#' to `№' as expected.
> It is not very useful in markdown files. So I put
>
> lunmap <buffer> #
>
> in ~/.vim/after/ftplugin/markdown.vim. Then strange things begin to
> happen. When I open markdown document from running vim it shouts
>
> E31: No such mapping
>
> and points on that line. But after that mapping exists. When I start
> to edit markdown from command line everything is fine.
>
> Using autocommand instead of script in "after" directory leads to the
> same.
>
> The exact question is how to properly unmap this kind of mapping?
> Thanks for any help.

Apparently the keymap script is sourced after ftplugin and syntax scripts,
and after BufEnter. I think I'd go with

" ~/.vim/after/ftplugin/markdown.vim
augroup MarkdownKeymapFix
au! InsertEnter <buffer> lunmap <buffer> #|au! MarkdownKeymapFix
augroup End

--
Andy

--
--
You received this message from the "vim_use" 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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment