Skip to content

marzeq/visual-commit.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

visual-commit.nvim

a neovim plugin that provides a UI for creating git commits. still very WIP, expect bugs and weird behaviour

why use this?

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

preview

image

installation

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
},

usage

the commit window can be launched in two ways:

  1. using the :VisualCommit command
  2. 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 the git commit command
  • require('visual-commit').commit("--amend") or require('visual-commit').commit({ "--amend" }) will do the same in lua

features

  • 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

known bugs/limitations

  • 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

credits

license & usage

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages