mirror of
https://github.com/js0ny/dotfiles.git
synced 2026-03-22 18:52:43 +00:00
chore: reorg
This commit is contained in:
parent
e0a023da4f
commit
1b5c26bc04
54 changed files with 411 additions and 227 deletions
27
home/dot_config/nvim/lua/config/fcitx.lua
Normal file
27
home/dot_config/nvim/lua/config/fcitx.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
vim.g.input_layout = nil
|
||||
|
||||
local function fcitx2en()
|
||||
local current_layout = vim.fn.system("fcitx5-remote -n")
|
||||
vim.g.input_layout = vim.trim(current_layout)
|
||||
vim.fn.system("fcitx5-remote -s keyboard-us")
|
||||
end
|
||||
|
||||
local function fcitx2zh()
|
||||
if vim.g.input_layout ~= nil and vim.g.input_layout ~= "" then
|
||||
vim.fn.system("fcitx5-remote -s " .. vim.g.input_layout)
|
||||
end
|
||||
end
|
||||
|
||||
vim.opt.ttimeoutlen = 150
|
||||
|
||||
local fcitx_group = vim.api.nvim_create_augroup("FcitxToggle", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||
group = fcitx_group,
|
||||
callback = fcitx2en,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("InsertEnter", {
|
||||
group = fcitx_group,
|
||||
callback = fcitx2zh,
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue