Skip to content

tonyfettes/fcitx5.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

fcitx5.nvim

[WIP but already in maintenance] Fcitx5 client in neovim

Reminds

This plugin needs to be run with corresponding input method frontend disabled in either your Neovim UI (terminal emulator or GUI), or Fcitx5.

Demo

recording.mp4

Install

If you use packer.nvim,

use {
  'tonyfettes/fcitx5.nvim'
  tag = 'v0.0.1-alpha',
  rocks = {'dbus_proxy', 'lgi'}
}

Then, check if corresponding Input method frontend is disabled in Fcitx5 configuration, if your terminal/GUI support that. Otherwise, your terminal/GUI will capture your keystrokes and sent them to Fcitx5 instead of Neovim.

Setup

The example below shows the default values.

lua<<EOF
require'fcitx5'.setup = {
  ui = {
    separator = '',
    padding = { left = 1, right = 1 }
  }
}
EOF

hi link Fcitx5CandidateNormal None
hi link Fcitx5CandidateSelected Search
hi link Fcitx5PreeditNormal None
hi link Fcitx5PreeditUnderline Underline
hi link Fcitx5PreeditHighLight IncSearch
hi link Fcitx5PreeditDontCommit None
hi link Fcitx5PreeditBold Bold
hi Fcitx5PreeditStrike gui=strikethrough
hi link Fcitx5PreeditItalic Italic

Quick Start

use {
  'tonyfettes/fcitx5.nvim',
  config = {
    -- Load `fcitx5.nvim`
    require'fcitx5'.setup {}
    -- Map <M-Tab> to toggle between most recent two input methods.
    vim.cmd[[inoremap <M-Tab> <Cmd>lua require'fcitx5'.toggle()<CR>]]
  },
  -- Add luarocks dependencies
  rocks = { 'lgi', 'dbus_proxy' }
}

Roadmap

  • Fix error on exit
  • Switchable input method and group (currently hardcoded to 'rime')
  • Break into two windows for pre-edit and candidate list respectively
  • Select candidates with function
  • Highlight
    • Pre-edit highlight
  • UI glitch on first keystroke after insert
  • Candidate list margin
  • Commit when focus out
  • True Client side pre-edit support.
  • Double-line mode, i.e. pre-edit is embedded in input method panel.
  • Horizontal/Vertical layout
  • Command-line support
  • (Perhaps) CursorMovedI/InsertCharPre to nvim_buf_attach()
  • (Perhaps) Show current input method and input group using dedicated window
  • If 'wrap' is not set, scroll horizontal if pre-edit is too long, otherwise move to next line. Too hard.