Hello Bodo,

> Message de Bodo Graumann: Mon 28/06/10, 20:47:57 +0200
> I too have been looking for such a feature but without success so far.
> Vims imap / iab commands don't support unicode in my setup. I
> understand you have made that possible? I really would be interested in
> how, and maybe I could apply this to IMAP...

So at least one person except me is interested.  :-) 

I did not succeed (and did not try) to modify imap / iab, but IMAP
itself. IMAP accepts multibyte characters in the lhs but works wrongly
with it, as I reported in my first post. The reason of the problem is
that IMAP uses strlen() and strpart() functions of vim, which change
strings byte per byte instead of character per character. I just
filled this gap by writing analogous functions dealing with strings
character by character and replaced strlen and strpart by my
functions in various places. And it works!

> btw, why do you want to replace it this way? I myself have those
> unicode symbols accessible via my keyboard (neo-layout.org) and would
> like to replace them with the latex-command: „call IMAP("∃", "\exists",
> "tex");“. But could not imagine the use of the other direction...

I do not have such keys in my keyboard, I have a plane qwerty keyboard.
What I wanted is an easy access to mathematical unicode symbols from
my keyboard, not necessarily for LaTeX, but for mail, plain text,
whatever. For example I can type in this mail: ∀ ε ≤ 1, ∃ ζ ∈ ℂ… and
so on. (Apparently these characters are displayed properly on
the web site, I hope it is the same for your mail viewer.)

You may say that this is of limited use. Well, I use it with some of
my colleagues and I like it, but I agree that it is sort of a game. 

What I really wanted actually was that when I open a tex file all the
LaTeX macros that it contains for mathematical symbols are converted
to UTF8 glyphs which represent them, and when I save the file the UTF8
characters are converted back. So that I have a more "wysiwyg" LaTeX
editor, with much more compact and readable formulas, but still have
plain ascii LaTeX file, which latex can compile without problem. 

The plugin unilatex.vim does exactly this, but I experienced some
problems with it (it makes non-reversible conversions between UTF8 and
LaTeX) and missed some features such as the possibility at some point
to see what are the actual macros I typed before continuing. So I
needed a function doing conversions for some parts of the file at any
moment, not only when loading and saving the file. And moreover I
wanted to use IMAP mappings instead of imap mappings as provided by
unilatex.vim.

So I wrote my own plugin. I would like to share it with other people,
and I would prefer it to be fully compatible with the IMAP function
coming with imaps.vim (and the latex-suite), instead of replacing it
with my own version of IMAP which would not be compatible with the
official one. 

I'll send you my modified version of imaps.vim in the next post, so
that you can test it if you want. You just have to move your imaps.vim
to imaps.vim.bak, say, in order to disable it, and save my variant in
your directory for vim's plugins (~/.vim/plugin in Linux) with name
imaps_modified.vim if you want.

Best regards,
LuX. 


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to