SCIM

The Smart Common Input Method "provides not only a user friendly, full featured input method user interface for POSIX-style operating systems (including Linux, FreeBSD and other Unix), but also a development platform to make input method development easier." ~ SCIM Homepage

For example, to use Chinese pinyin with Vim type the following...

# scim & # export LANG=zh_CN.utf8 # gvim  