Friday, October 25, 2013

RE: Re: vim-latex/latex-suite macros like FEM in nonEnglish languages

>>>> I work on a book in Russian using vim-latex. While in insert
>>>> mode in Russian (with keymap command c-^) latex-suite
>>>
>>> macros like FEM don't work.
>>>>
>>>> Thats indeed very embarrassing. Is there a way to get them
>>>> work in
>>>
>>> nonEnglish languages?
>>>>
>>>> Thanks!
>>>
>>>Nikolay Pavlov:
>>> You mean, those that are created using IMAP function? AFAIK
>>> they work like this: map the last character (M in your case)
>>> and when it is typed check whether the preceding characters
>>> are present just before the cursor. If they are, IMAP deletes
>>> them and does what it was requested, otherwise it returns the
>>> last character which will then be inserted. I do not know how
>>> mappings interact with &keymap, but as with &keymap preceding
>>> characters (FE in your case) are replaced with Russian ones
>>> IMAP will not work. I do not know any way around this without
>>> modifying IMAP to be &keymap-aware.
>>>
>>> I personally just disabled all these macros for them being too
>>> intrusive (do not remember which of them exactly though).
>>
>>

Nikolay Pavlov:
> Please read my message. IMAP does *not* map FEM. It maps M and
> checks whether there are FE letters present just before the cursor
> when you trigger the M map. It is a poor men infinite timeout for
> insert mode. AFAIR one of the reasons I disabled all of the
> mappings is that I could not type some sequences anymore. I
> remember something starting/ending with backticks. Second was
> that no trick like Space CTRL-H Key works: unlike my translit3
> which uses similar approach IMAP does not bother mapping F and E
> and hence does not bother remembering where I started typing. (If
> translit3 detects that I started typing the sequence in one place,
> but am now typing in the other, even with same characters before
> the cursor, it no longer considers new key a continuation of the
> old sequence. Same if you typed some character that translit3
> mapped, but that is not the part of current sequence: no CTRL-H/BS
> will allow old sequence to continue.)

to Nikolay Pavlov:

You are absolutely right!
But I know that I will never use the word "АУЬ" (FEM in Russian
keymap) in Russian language, since it can not be even an
abbreviation.
So for the few macros I have liked to use in English
I just tried to make the analogue in Russuan:
In file
~/.vim/ftplugin/latex-suite/elementmacros.vim
I found the command:
if g:Tex_FontMaps | exe 'call IMAP ("FEM", "\\emph{<++>}<++>", "tex")' | endif
and created another one:
if g:Tex_FontMaps | exe 'call IMAP ("АУЬ", "\\emph{<++>}<++>", "tex")' | endif
(FEM and АУЬ occupy the same physical keys on the keybord for
English and Russian keymap)

But ... it does not work((

Finally I wonder why is it only me who tries to use vim-latex
macros in Russian on other languages???

I understand your critics of vim-latex mappings:
it may happen that you will need FEM in your text, f.e. FEM as an
acronym for "finite element method",
but anyway there is a need for such macros: it is much easier to
type FEM and get \emph{<++>}<++> than typing it directly,
not to mention `/ for \frac{}{<++>}<++> etc.

Thank you!



--
--
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/groups/opt_out.

No comments: