Tuesday, November 27, 2012

Re: special keymap depending on language

On 27/11/12 16:33, Tony Mechelynck wrote:
> On 27/11/12 13:53, Steve wrote:
>> Dear Tony and linth,
>>
>> Thank you for your answers.
>>
>>>> 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
>>>>
>>>
>>> Well, it would be possible if there is some computer-readable
>>> criterion to tell French-language and English-language email apart
>>> from each other.
>>>
>>> One possibility would be to set different keymaps and load them
>>> manually when opening the message for editing.
>>
>> I think that this is the easier solution for me. I'll try that and see
>> if it fits my needs. The hardest part will be to not forget to load the
>> keymap :)
>>
>> Thank you,
>> steve
>>
>
> In order not to forget that a keymap (and which one) is loaded and
> active, I display it on my 'statusline', it's the %k field after the %=
> (%= means "flexible space"):
>
> " custom status line, see :help 'statusline' for details
> if has("statusline")
> set statusline=%<%f\ %h%m%r%=%k[%{(&fenc\ ==\
> \"\"?&enc:&fenc).(&bomb?\",BOM\":\"\")}][U+%04B]\ %-12.(%l,%c%V%)\ %P
> endif

P.S. I also set the lCursor highlight (cursor with keymap active) to a
different colour than Cursor (cursor when neither keymap nor IM are active)

see :help 'guicursor'

>
>
> Best regards,
> Tony.
--
Q: Why does Helen Keller masturbate with one hand?
A: So she can moan with the other!

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

Post a Comment