Use luagit2 to realize a :Git
in neovim.
- vim-fugitive: call git process synchronously. written in vim script.
- vim-gina: call git process asynchronously. written in vim script. stop maintenance.
- vim-gin: call git process asynchronously. written in denojs. same author as vim-gina.
- vim-flog: call git process synchronously. written in vim script.
- committia.vim: UI for CLI's
git commit
. call git process synchronously. written in vim script. - nvim-tinygit: call git process asynchronously. written in lua.
- neogit: call git process asynchronously. written in lua.
- blame.nvim: UI for
git blame
. call git process asynchronously. written in lua. inspired fugit2.nvim'sFugit2Blame
- fugit2.nvim: call libgit2 by luajit FFI. written in lua.
- coc-git: call git process asynchronously. issue about libgit2
- fern-git-status.vim: call git process synchronously.
- fern-mapping-git.vim: call git process synchronously.
- magit: git UI for emacs
- Many vim users are experienced CLI users, a vim command
:Git
like CLI'sgit
should be helpful to save their learning time. A good CLI even is a more significant matter than UI. In this aspect, vim-fugitive, vim-gina do well. - call git process synchronously is slow. many vim plugins select use vim
script's
jobstart()
or neovim'svim.uv.timer
to call git process asynchronously. fugit2.nvim is 1st plugin to call libgit2 and bring novelty to vim community. Don't call git process can avoid some bug of incorrect shell settings. On Oct 2024, official lua binding of libgit2 lua-git2 is released firstly. I believe it can bring more convenience to vim plugin developing and start the experiment.
# Ubuntu
sudo apt-get -y install libgit2-dev libgit2
sudo apt-mark auto libgit2-dev
# ArchLinux
sudo pacman -S libgit2
# Android Termux
apt-get -y install libgit2
# Nix
# use nix-shell to create a virtual environment then build
# homebrew
brew tap tonyfettes/homebrew-git2
brew install libgit2 pkg-config
# Windows msys2
pacboy -S --noconfirm pkg-config libgit2 gcc
:Rocks install git2.nvim
~/.config/nvim/rocks.toml
:
[plugins]
"git2.nvim" = "scm"
Then
:Rocks sync
or:
$ luarocks --lua-version 5.1 --local --tree ~/.local/share/nvim/rocks install git2.nvim
# ~/.local/share/nvim/rocks is the default rocks tree path
# you can change it according to your vim.g.rocks_nvim.rocks_path
:edit subdir/test.txt
:Git init
:cd subdir
:Git -C .. add %