https://github.com/blurgyy/fcitx5-ui-rs.nvim

Fcitx5 integration for Neovim

https://github.com/blurgyy/fcitx5-ui-rs.nvim

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Fcitx5 integration for Neovim

Basic Info
  • Host: GitHub
  • Owner: blurgyy
  • License: gpl-3.0
  • Language: Rust
  • Default Branch: master
  • Size: 219 KB
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

fcitx5-ui-rs.nvim

This plugin allows using the Fcitx5 input method natively inside Neovim (v0.11+).

You can now use Fcitx5 remotely in an SSH session!

demo

See video https://github.com/user-attachments/assets/23e34a5a-ae3b-4531-bd3d-8786fbea6695

Installation

I personally use Nix for plugin management, but a general installation guide and an example that works on a bare-bones nvim instance are provided here. Please feel free to open a PR to add better out-of-the-box installation support for your favorite plugin manager.

Click to expand ### General This plugin is a single .so binary. A vanilla installation process would be: 1. Build the plugin with `cargo build --release`, this gives you a binary at `target/release/libfcitx5_ui_rs.so`. 2. The binary needs to be renamed to `lua/fcitx5_ui_rs.so` (remove the "`lib`" prefix), and put inside your Neovim's [`rtp`]. For example, here is how to test this plugin imperatively: ```bash cd fcitx5-ui-rs.nvim/plugin cargo build --release # <-- This gives target/release/libfcitx5_ui_rs.so mkdir lua mv ./target/release/libfcitx5_ui_rs.so lua/fcitx5_ui_rs.so # <-- NB: must remove the `lib` prefix! # Then launch nvim. # We add $(pwd) to nvim's rtp so that it can find lua/fcitx5_ui_rs.so. nvim +"set rtp^=$(pwd)" +'lua require("fcitx5_ui_rs").setup({ on_key = "", })' # See the configuration guide below # Then hit Alt+Space inside nvim, and try typing something! ``` ### NixOS Add this project's to your flake's input: ```nix { inputs.fcitx5-ui-rs-nvim.url = "github:blurgyy/fcitx5-ui-rs.nvim"; # ... } ``` Add to your nixpkgs's overlay: ```nix pkgs = import nixpkgs { overlays = [ # ... inputs.fcitx5-ui-rs-nvim.overlays.default ]; }; ``` The plugin can now be built via `pkgs.vimPlugins.fcitx5-ui-rs-nvim`. You can then add it to your Neovim plugins.

Configuration

To load the plugin, call require('fcitx5_ui_rs').setup({}):

lua require('fcitx5_ui_rs').setup({ on_key = "<M-Space>", -- Use Alt+Space to toggle the plugin. Default value of on_key is nil })

Showing current IM on lualine

```lua function lualinegetim() local im = require("fcitx5uirs").get_im() local mapping = { [""] = "", ["keyboard-us"] = " ", ["pinyin"] = "中", } if mapping[im] then return mapping[im] else return "? " -- unrecognized, shouldn't ever be seen end end

local cfg = require('lualine').getconfig() table.insert( cfg.sections.lualiney, 'lualinegetim()' ) require('lualine').setup(cfg) ```

Limitations

This plugin depends on Fcitx5's DBus frontend, it would not work on a system without DBus.

Known Problem

  • Special characters like #, `, $, %, etc. are inserted after space, if they are selected with a space key.

Thanks

This project would not be possible without the following projects:

  • fcitx5-ui.nvim: Integrates Fcitx5 via DBus, but using lua. This project was inspired by it, but solves various lua dependency problems on NixOS.
  • nvim-oxi: Provides Rust bindings for Neovim internals.
  • fcitx5-dbus: Provides DBus interface for Fcitx5 in Rust.

Contribution

Contributions are welcome. Feel free to send issues or PRs!

License

GPL-3.0.

Owner

  • Name: Gaoyang Zhang
  • Login: blurgyy
  • Kind: user
  • Company: Zhejiang University

GitHub Events

Total
  • Watch event: 4
  • Push event: 13
  • Create event: 1
Last Year
  • Watch event: 4
  • Push event: 13
  • Create event: 1

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 120
  • Total Committers: 1
  • Avg Commits per committer: 120.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 120
  • Committers: 1
  • Avg Commits per committer: 120.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Gaoyang Zhang gy@b****z 120
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

plugin/Cargo.lock cargo
  • 101 dependencies
plugin/Cargo.toml cargo