im-switch.nvim

April 24, 2025 ยท View on GitHub

Neovim plugin to automatically switch input method without delay.

More neovim plugins

Config

Default configuration here.

require("im-switch").setup({
	is_active = function(resolve)
		vim.system({ "fcitx5-remote" }, nil, function(res)
			resolve(string.find(res.stdout, "1") == nil)
		end)
	end,
	active_input_method = function()
		vim.system({ "fcitx5-remote", "-o" })
	end,
	inactive_input_method = function()
		vim.system({ "fcitx5-remote", "-c" })
	end,
})