xkblayout: support ime.nvim (#2682)
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled

Improve document
This commit is contained in:
wzy 2024-07-23 22:10:19 +08:00 committed by GitHub
parent 02894b6ef4
commit d25c049e61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View File

@ -16,11 +16,15 @@ function! airline#extensions#xkblayout#status()
elseif exists('*FcitxCurrentIM')
let keyboard_layout = FcitxCurrentIM()
elseif has('nvim')
try
let keyboard_layout = luaeval('require"ime".current()')
catch /.*/
try
let keyboard_layout = luaeval('require"fcitx5-ui".displayCurrentIM()')
catch /.*/
let keyboard_layout = ''
endtry
endtry
else
let keyboard_layout = ''
endif

View File

@ -1775,7 +1775,11 @@ details on how to use it, see e.g. <https://github.com/ierton/xkb-switch>
let g:XkbSwitchLib = '/usr/local/lib/libInputSourceSwitcher.dylib'
<
Linux with fcitx (Install https://github.com/fcitx/fcitx5):
Install https://github.com/lilydjwg/fcitx.vim) to get `FcitxCurrentIM()`
Install https://github.com/lilydjwg/fcitx.vim to get `FcitxCurrentIM()`
or https://github.com/black-desk/fcitx5-ui.nvim to get
`luaeval('require"fcitx5-ui".displayCurrentIM()')`
or https://github.com/Freed-Wu/ime.nvim to get
`luaeval('require"ime".current()')`
------------------------------------- *airline-xtabline*
xtabline <https://github.com/mg979/vim-xtabline>