[EMAIL PROTECTED] wrote:
Hi, A.J.Mechelynck:
I want to set up my own macros for typing in LaTeX environment: I put those into my _vimrc file, but when I save it and run gvim7.0 again,
it reports error that IMAP does not exist.
Can you tell me how to configure this?
Thanks a lot
call IMAP('kk','\[<++>\]<++>','tex')
call IMAP('dkdk','\{<++>\}<++>','tex')
call IMAP('nn','\|<++>\|<++>','tex')
call IMAP('AA','|<++>|<++>','tex')
call IMAP('BEA',"\\begin{eqnarray*}<CR><++><CR>\\end{eqnarray*}<++>",'tex')
call IMAP('`j','\phi','tex')
call IMAP('`o','\epsilon','tex')
call IMAP('`Q','\Theta','tex')
call IMAP('`F','\Phi','tex')
call IMAP('TRI','\triangle','tex')
call IMAP('MB','\mathbb','tex')
call IMAP('CAL','\mathcal','tex')
call IMAP('OO','\overline{<++>}<++>','tex')
call IMAP('UU','\underline{<++>}<++>','tex')
Ting



1. I'm just a plain Vim user, and TeX is not particularly my specialty. Next time, please ask questions about Vim on the public mailing list (which means subscribing to the list if you didn't already do it).

2. To set up mappings, use the ":map" command and its variations. I suspect that what you want here is to create or modify a file named (in Vim terminology):
(on Windows) ~/vimfiles/after/ftplugin/tex.vim
(on Unix) ~/.vim/after/ftplugin/tex.vim

and containing:

        imap <buffer> kk     <Bslash>[<lt>++><Bslash>]<lt>++>
        imap <buffer> dkdk   <Bslash>{<lt>++><Bslash>}<lt>++>
        imap <buffer> nn     <Bslash><Bar><lt>++><Bslash><Bar><lt>++>

etc. However, I am _not_ a TeX specialist and I may have misunderstood you. Also, I don't know the LaTeX-suite plugin so this answer may be totally off the mark.

Note that the insert-mode mappings I listed (and others like them) will prevent you from inserting the corresponding sequences of letters in the text of a TeX file: for instance, if you type "running" it will become "ru\|<++>\|<++>ing" which is perhaps not what you want.

See
        :help map.txt
        :help map-overview
        :help :map-local
        :help key-notation


Best regards,
Tony.

Reply via email to