Home

Awesome

<h1 align="center">Fcitx.nvim</h1>

A Neovim plugin for storing and restoring fcitx status of several mode groups separately.

This plugin stores fcitx status while leaving a <ins>mode group</ins> and restores a mode group's fcitx status while entering this group. All disabled mode groups and other modes share one status.

P.S. This plugin uses timer of vim.loop to make some delay, in order to avoid too frequent switching.

Mode group(see :h mode() and :h ModeChanged):

Installation

With packer.nvim:

require('packer').startup(function()
  use { 'alohaia/fcitx.nvim'
    config = function ()
        require 'fcitx' {
            -- options
        }
    end
  }
end)

With my built-in packer(See here):

['alohaia/fcitx.nvim'] = {
    -- ft = 'rmd,markdown,text',
    config = function ()
        require 'fcitx' {
            -- options
        }
    end
}

Options

Default options:

enable = {
    normal   = true,
    insert   = true,
    cmdline  = true,
    cmdtext  = true,
    terminal = true,
    select   = true,
},
guess_initial_status = {
    normal   = {},
    insert   = {'select', 'cmdtext'},
    cmdline  = {'normal'},
    cmdtext  = {'cmdline', 'insert'},
    terminal = {'cmdline', 'normal'},
    select   = {'insert', 'cmdtext'},
},
threshold = 30,
log = false,

The guessing strategy means, for example, the plugins will guess insert's initial status from select or cmdtext group. If the status of any of select and cmdtext groups is stored before, it will be used as insert's initial status.

For instance, you don't want guess insert's initial status, thus you can set guess_initial_status like this:

guess_initial_status = {
    insert = {}
}

It's the same as

guess_initial_status = {
    normal   = {},
    insert   = {},
    cmdline  = {'normal'},
    cmdtext  = {'insert', 'select'},
    terminal = {'cmdline', 'normal'},
    select   = {'insert', 'cmdtext'},
}

Tips: You can just set enable.select = "insert" to keep the statuses of select and insert the same. It's like that they are one group.

Alternative