{"id":13478016,"url":"https://github.com/noib3/nvim-oxi","last_synced_at":"2025-05-14T00:04:35.681Z","repository":{"id":37825881,"uuid":"491484827","full_name":"noib3/nvim-oxi","owner":"noib3","description":":link: Rust bindings to all things Neovim","archived":false,"fork":false,"pushed_at":"2025-04-25T20:16:18.000Z","size":1686,"stargazers_count":1008,"open_issues_count":19,"forks_count":49,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-13T15:15:01.502Z","etag":null,"topics":["neovim","rust","rust-bindings"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/nvim-oxi","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noib3.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-12T11:27:07.000Z","updated_at":"2025-05-13T11:54:28.000Z","dependencies_parsed_at":"2023-12-19T09:59:13.356Z","dependency_job_id":"786780d6-8208-4c30-914f-8a0c12573ffb","html_url":"https://github.com/noib3/nvim-oxi","commit_stats":{"total_commits":669,"total_committers":14,"mean_commits":"47.785714285714285","dds":0.5171898355754858,"last_synced_commit":"b986c4951db0aa21c6627bf25c5d9e3e931ade07"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noib3%2Fnvim-oxi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noib3%2Fnvim-oxi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noib3%2Fnvim-oxi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noib3%2Fnvim-oxi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noib3","download_url":"https://codeload.github.com/noib3/nvim-oxi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253972480,"owners_count":21992917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neovim","rust","rust-bindings"],"created_at":"2024-07-31T16:01:51.313Z","updated_at":"2025-05-14T00:04:35.624Z","avatar_url":"https://github.com/noib3.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# 🔗 nvim-oxi\n\n[![Latest version]](https://crates.io/crates/nvim-oxi)\n[![CI]](https://github.com/noib3/nvim-oxi/actions)\n[![Docs]](https://docs.rs/nvim-oxi)\n\n[Latest version]: https://img.shields.io/crates/v/nvim-oxi.svg\n[CI]: https://github.com/noib3/nvim-oxi/actions/workflows/ci.yml/badge.svg\n[Docs]: https://docs.rs/nvim-oxi/badge.svg\n\nnvim-oxi provides safe and idiomatic Rust bindings to the rich API exposed by\nthe [Neovim](https://neovim.io) text editor.\n\nThe project is mostly intended for plugin authors, although nothing's\nstopping end users from writing their Neovim configs in Rust.\n\n## How\n\nThe traditional way to write Neovim plugins in languages other than the\n\"builtin\" ones, i.e. Vimscript or Lua, is via [RPC\nchannels](https://neovim.io/doc/user/api.html#RPC). This approach comes with a\nfew limitations mostly due to having to (de)serialize everything to\nMessagePack-encoded messages, prohibiting things like attaching callbacks to\nkeymaps or scheduling functions.\n\nnvim-oxi takes a different approach. It leverages Rust's foreign function\ninterface (FFI) support to hook straight into the Neovim C code, allowing\nfeature parity with \"in process\" plugins while also avoiding the need for an\nextra IO layer.\n\n[This\nthread](https://neovim.discourse.group/t/calling-neovim-internal-functions-with-luajit-ffi-and-rust)\non the Neovim discourse goes into a bit more detail for anyone who's\ninterested.\n\n## Why\n\nWhy bother when Neovim already has Lua as a first-class citizen? Mainly two\nreasons:\n\n- access to the Rust ecosystem: Lua is a great, minimal scripting language but\n  can also be limiting when writing more complex plugins. In contrast Rust is\n  a fully-fledged, statically typed language with a huge ecosystem of crates\n  for (de)serialization, networking, IO, green threads, etc;\n\n- nvim-oxi provides a fully typed API: everything from optional function\n  fields to callback arguments is checked at compile-time. This allows plugin\n  authors to spend less time reading through the help docs and more time\n  iterating via `cargo check`s.\n\n## Examples\n\nThe [examples](https://github.com/noib3/nvim-oxi/tree/main/examples)\ndirectory contains several examples of how to use nvim-oxi. It also contains\ninstructions on how to setup your Rust crate, where to place the compiled\nartifacts and how to load the final plugin from Neovim.\n\nIf you're still not sure about something feel free to open a new issue and I\nmight add a new example documenting your use case (if it can be done).\n\n## Testing\n\nTurning on the `test` feature enables `#[nvim_oxi::test]`, which replaces the\nregular `#[test]` macro and allows you to test a piece of code from within a\nNeovim instance using Rust's testing framework.\n\nFor example:\n\n```rust\nuse nvim_oxi::api;\n\n#[nvim_oxi::test]\nfn set_get_del_var() {\n    api::set_var(\"foo\", 42).unwrap();\n    assert_eq!(Ok(42), api::get_var(\"foo\"));\n    assert_eq!(Ok(()), api::del_var(\"foo\"));\n}\n```\n\nWhen `cargo test` is executed, the generated code will spawn a new Neovim\nprocess with the `nvim` binary in your `$PATH`, test your code, and exit.\n\nThere's a gotcha: you can't have two tests with the same name in the same\ncrate, even if they belong to different modules. For example, this won't work:\n\n```rust\nmod a {\n    #[nvim_oxi::test]\n    fn foo() {}\n}\n\nmod b {\n    #[nvim_oxi::test]\n    fn foo() {}\n}\n```\n\nNote that all integration tests must live inside a separate `cdylib` crate with\nthe following build script:\n\n```rust\n// build.rs\nfn main() -\u003e Result\u003c(), nvim_oxi::tests::BuildError\u003e {\n    nvim_oxi::tests::build()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoib3%2Fnvim-oxi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoib3%2Fnvim-oxi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoib3%2Fnvim-oxi/lists"}