Skip to content

hnjae/fcitx.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fcitx.nvim

This Neovim plugin switches the IME when InsertEnter/InsertLeave events occur.

Installation

With lazy.nvim:

{
  "hnjae/fcitx.nvim",
  -- default-config:
  opts = {
    ---@type number?
    sleep = 0

    ---@type boolean?|fun(): boolean
    enable = function()
      return vim.fn.has("linux") == 1
        and os.getenv("SSH_TTY") == nil
        and os.getenv("DISPLAY") ~= nil
        and os.getenv("XMODIFIERS") == "@im=fcitx"
        and vim.fn.executable("fcitx5-remote") == 1
    end
  },
},

What does sleep option do?

This option adds a delay in switching to a non-Latin character IME. As of 2023, not having this delay exposes a bug in Wayland that triggers key repeat behavior when typing Korean via Wayland protocol (e.g., text-input-v3). If you encounter a similar bug, consider using this option. Without the sleep option, the IME will change immediately.

fcitx5-wayland-bug.mp4

Differences compare to h-hg's version

  • Includes the sleep option.
  • IME switching scope is window-based, not buffer-based. The same buffer in different windows will have independent IME status.
  • No cmdline event handling.
  • GPL3 License.

About

Switch IME based on InsertEnter/InsertLeave events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published