a neovim plugin that provides a UI for creating git commits. still very WIP, expect bugs and weird behaviour
you see, you probably shouldn't. vim fugitive is miles better and more feature-rich. i just wanted to make my first plugin and this seemed like a good idea, and also because i don't need all the features of vim fugitive, just a simple way to stage files and write a commit message
using lazy.nvim:
{
"marzeq/visual-commit.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim", -- required by telescope
},
opts = {}, -- no configuration yet, but this is for when there is one
},
the commit window can be launched in two ways:
- using the
:VisualCommit
command - by running
require('visual-commit').commit()
in lua
you can use these to create a keybinding for the commit window:
{
-- ... plugin table
keys = {
{ "<leader>c", require("visual-commit").commit, desc = "Create a git commit" },
-- OR
{ "<leader>c", ":VisualCommit<CR>", desc = "Create a git commit" },
},
},
additional arguments to git commit
can be passed in the command like so:
:VisualCommit --amend
will add the--amend
flag to thegit commit
commandrequire('visual-commit').commit("--amend")
orrequire('visual-commit').commit({ "--amend" })
will do the same in lua
- a simple menu that allows for selecting the files to stage and inputting the commit message
- visually separate the already staged, unstaged, and untracked files
- an optional second screen that shows the diff and asks for confirmation
- passing on arguments to
git commit
in the command/method arguments - default arguments for
git commit
in opts
- when commit signing is enabled and the ncurses dialog is used, it will screw up the terminal and you will have to restart neovim (fix -> use a different pinentry program). don't know if i will ever fix this
- nvim-telescope/telescope.nvim for the input UI framework
- ellisonleao/nvim-plugin-template for the plugin template
licensed under MIT (see LICENSE)
if you plan on using this plugin in a distribution, i would appreciate it if you let me know and credited me properly