Template for ModProg/nvim-rust
- Install
cargo install cargo-hatch
- Use template
cargo hatch git https://github.com/ModProg/nvim-rust-hatch
- Install
cargo install cargo-make
makers release
- Copy
lua/*
tolua
in the nvim config directory - Add
require"{{ module_name }}".setup()
to yourinit.lua
makers run
- Adjust invocation of plugin in
Makefile.toml
:
exec nvim --cmd "set runtimepath+=." "+lua require'${module_name}'.hello()"
depends on cargo-make
:
use {
'ModProg/rust-nvim-template',
run = 'makers release',
config = function()
require"{{ module_name }}".setup()
end
}
- Compile the code with
cargo build --release
- Copy
target/release/lib{{ project_name | replace(from="-", to="_") }}.so
to your nvim directorylua/{{ module_name }}.so
- Add
require"{{ module_name }}".setup()
to your nvim initialization (i.e.init.lua
)