updated on Sun Jan 22 16:00:49 UTC 2012
[aur-mirror.git] / fcitx4vim / fcitx.install
blob4bcf97e9aebddb747150934ab888eb6a2ebd49c3
1 pkgname=fcitx
3 post_install() {
4   cat << EOF
5   > please add the follow lines into your ~/.vimrc file, and then restart X.
7 let g:input_toggle = 0
8 function Fcitx2en() 
9         let s:input_status = system("fcitx-remote")
10         if s:input_status == 2
11                 let g:input_toggle = 1
12                 let l:a = system("fcitx-remote -c")
13         endif
14 endfunction
16 function Fcitx2zh() 
17         let s:input_status = system("fcitx-remote")
18         if s:input_status != 2 && g:input_toggle == 1
19                 let l:a = system("fcitx-remote -o")
20                 let g:input_toggle = 0
21         endif
22 endfunction
24 set timeoutlen=150
25 autocmd! InsertLeave * call Fcitx2en()
26 autocmd! InsertEnter * call Fcitx2zh()
28 EOF
31 post_uninstall() {
32   cat << EOF
33   > Don't forget to remove the follow lines from your ~/.vimrc file.
35 set timeoutlen=150
36 autocmd! InsertLeave * call Fcitx2en()
37 autocmd! InsertEnter * call Fcitx2zh()
39 EOF
42 post_upgrade() {
43   post_install $1
46 post_remove() {
47   post_uninstall $1