# Triggering automatic replacements of certain strings

I am using the Vim version 8.0 editor, mostly via GVim. I would like to be able to type unicode/greek characters like lambda, mu, alpha inside my Haskell scripts.

There is a vim plugin called latex-unicoder which is almost what I want. The disadvantage of the plugin is that I need to repeatedly go into Normal mode, press Ctrl-L insert the latex symbol for the character and then manually go back into insert mode.

This is quite tedious. Emacs has something called M-x set-input-method [RET] tex which automatically and immediately replaces the occurences of \lambda, \alpha by their corresponding Greek characters.

Since I intend to use only a handful of greek characters, I am willing to manually create such a dictionary of Greek characters for automatic insertion when their latex name is written.

How should I go about doing this?

• I've never used latex-unicoder so this might not work but if the ctrl-l mapping of this plugin is what you want excepted that it makes you quit insert mode, maybe you can try an insert mode mapping? Something like this imap <C-l> <Esc><C-l> or something more complexe which will make you go back to insert mode too. – statox Jul 25 '17 at 6:58

you can do something like :iab \mu µ
Note however that this requires :set isk+=\ which may not always be desirable.
Another approach is :imap \mu µ . But this has the drawback that things starting with \ will not show up until entered completely
• Use showcmd option to see a mapping as you type it in, at the right end of the last line. Read :help 'showcmd' for more information. – Jair López Jul 26 '17 at 8:36