Collection of utils for git in NeoVim were written in Rust.
You must have Rust to build this lib to shared library.
For Linux
git clone https://github.com/Nguyen-Hoang-Nam/git-utils.nvim.git
cd git-utils.nvim
mkdir -p lua
cargo build --release
cp target/release/libembed.so lua/git_utils.so
For MacOS, you need some configuration from this article
The empty string in branch function is require by mlua 😥. If you know how to create function without parameter, please make a pull request thanks.
require('git_utils').branch('')
Gitsigns.nvim've already had line blame, but they only show summary of commit. This function will show all information.
require('git_utils').blame(vim.fn.expand('%:p'), vim.api.nvim_win_get_cursor(0)[1])
Currently, this function only returns 2 properties, author and message.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.