mirror of
https://github.com/lilydjwg/fcitx.vim.git
synced 2026-01-07 19:37:27 +08:00
parent
dc95d0301b
commit
92247352c6
1 changed files with 11 additions and 2 deletions
|
|
@ -11,8 +11,7 @@ endif
|
||||||
let s:keepcpo = &cpo
|
let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" If g:fcitx5_remote is set (to the path to `fcitx5-remove`), use it to toggle IME state.
|
function s:setup_cmd()
|
||||||
if exists("g:fcitx5_remote")
|
|
||||||
function Fcitx2en()
|
function Fcitx2en()
|
||||||
let inputstatus = trim(system(g:fcitx5_remote))
|
let inputstatus = trim(system(g:fcitx5_remote))
|
||||||
if inputstatus == '2'
|
if inputstatus == '2'
|
||||||
|
|
@ -32,6 +31,11 @@ if exists("g:fcitx5_remote")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let g:loaded_fcitx = 1
|
let g:loaded_fcitx = 1
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" If g:fcitx5_remote is set (to the path to `fcitx5-remove`), use it to toggle IME state.
|
||||||
|
if exists("g:fcitx5_remote")
|
||||||
|
call s:setup_cmd()
|
||||||
|
|
||||||
" Otherwise, if python3 is available, use python and dbus to toggle IME state.
|
" Otherwise, if python3 is available, use python and dbus to toggle IME state.
|
||||||
elseif has('python3')
|
elseif has('python3')
|
||||||
|
|
@ -50,6 +54,11 @@ elseif has('python3')
|
||||||
|
|
||||||
let g:loaded_fcitx = 1
|
let g:loaded_fcitx = 1
|
||||||
endif
|
endif
|
||||||
|
catch
|
||||||
|
if executable('fcitx5-remote')
|
||||||
|
let g:fcitx5_remote = 'fcitx5-remote'
|
||||||
|
call s:setup_cmd()
|
||||||
|
endif
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue