Monday, November 26, 2012

special keymap depending on language

Hi,

I write in French and in English. In French, before a question mark, one needs
a non-breakable space but not in English. Somebody on this list nicely
suggested to create a file in ~/.vim/keymap/touchesfrmail.vim containing:

loadkeymap
<< «<Char-0xa0>
>> <Char-0xa0>»<Space>
? <Char-0xa0>?<Space>
! <Char-0xa0>!<Space>
: <Char-0xa0>:<Space>
; <Char-0xa0>;<Space>

(Sometimes, I don't want the trailing <Space>, but that's all right, I just
delete it with the backspace key, most of the time I want it.)

This file gets loaded by the following in my .vimrc:

autocmd FileType mail setlocal kmp=touchesfrmail


This works great when writing in French, I don't have to manually put a nb
space. But when writing in English, the same happens which I obviously don't
want. So my question is rather simple: can I load this file only when editing
in French?

Thank you,
best regards,
steve

--
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

No comments: