GitHunt
ZE

VI

Cargo Crate
Docs
License

A input method library for Vietnamese input engine written completely in Rust

What is this?

Since typing Vietnamese on Linux is pretty painful at the momment, a better
input engine is always needed. To accommodate the future engines that will be
built in Rust, this library existed to transform key inputs into the Vietnamese
string output.

If you wish to find out how it works, I have written a short blog post (in
Vietnamese) on how the library place a tone mark when it received the user
input. Read it
here.

Installation

Add vi to your dependencies in Cargo.toml.

[dependencies]
vi = "0.8.0"

Examples

With vi, you can start building your own Vietnamese IME without worrying about
how Vietnamese tone mark placement works. All you have to do is to implement a
keyboard listener & a key sending system.

fn main() {
    let inputs = vec![
        "viet65",
        "nam"
    ];

    let mut result = String::new();
    for input in inputs {
        vi::transform_buffer(&vi::VNI, input.chars(), &mut result);
        result.push(' ');
    }

    println!("{}", result); // prints "việt nam "
}

Please refer to the examples/ directory to learn more.

Support

  • VNI
  • Telex

Project status

Currently, this project is still at its early stage of development. There might
be some minor bugs but overall, it should be 95% functional.

Creator

Want to support me? Consider buying me a coffee:)

ko-fi

Languages

Rust99.2%Nix0.8%

Contributors

MIT License
Created December 15, 2019
Updated December 27, 2025