Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

fcVIMtx

A Neovim plugin that saves & restores Fcitx state between modes.

Requirements

  • Neovim (obviously)
  • Fcitx5 or Fcitx, with fcitx5-remote or fcitx-remote in $PATH

Installation

Using the builtin vim.pack (Neovim v0.12+)

vim.pack.add { 'https://github.com/0xsvenka/fcvimtx' }
require('fcvimtx').setup {}

Using lazy.nvim

{
  '0xsvenka/fcvimtx',
  config = function()
    require('fcvimtx').setup {}
  end,
}

Other plugin managers should follow similar patterns.

Usage

The setup function, as shown above, provides the default behavior: disable the input method after saving its state when leaving insert mode, then restore that state when entering insert mode.

Alternatively, you can bypass setup and create your own autocmds by using the functions provided by fcVIMtx:

local fcvimtx = require('fcvimtx')
fcvimtx.turn_on()
fcvimtx.turn_off()
fcvimtx.save()
fcvimtx.restore()

For reference, the setup function creates these two autocmds:

vim.api.nvim_create_autocmd('InsertEnter', {
  callback = fcvimtx.restore,
})
vim.api.nvim_create_autocmd('InsertLeave', {
  callback = function()
    fcvimtx.save()
    fcvimtx.turn_off()
  end,
})

Acknowledgements

About

A Neovim plugin that saves & restores Fcitx state between modes

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages