How many times have you been pairing on a feature and then when committing you had to manually paste their details for adding a Co-author to the commit?
This plugin automatically fetches author details from the repo's commit history and then adds it to your commit message.
It shows you a list of all the unique authors in your current repo on a nice fuzzy searchable list.
co-author.nvim automatically works with configured pickers and presents the list in a fuzzy searchable UI.
Here's a demo video for a quick walk-through.
Noticed something similar on a co-workers using IntelliJ, and I wanted it!
Before you begin, ensure you have met the following requirements:
- You have installed the latest version of
neovim - snacks.nvim picker β for prettier select UI and multi select (optional, recommended)
To get co-author.nvim, add the following to your plugin list:
-- Lazy
{
'2kabhishek/co-author.nvim',
dependencies = {
'folke/snacks.nvim',
},
cmd = {'CoAuthor'},
},
-- Packer
use '2kabhishek/co-author.nvim'
co-author.nvim adds a :CoAuthor command that will show you the list of unique co authors who have already contributed to the current git repo.
Multi-select Support: When using with snacks.nvim picker, you can select multiple co-authors at once:
- Use
<Tab>to select/deselect individual authors - Use
<Ctrl-a>to select all authors on a filtered list - Use
<Enter>to confirm your selection
If snacks.nvim is not available, it will fallback to the built-in vim.ui.select for single selection.
You can add your custom bindings for the command :CoAuthor, the recommended keybinding is <leader>gC.
check :help co-author for more details.
NOTE: By default there are no configured keybindings.
co-author.nvim was built using neovim, lua
Figuring out vim's rtp was tricky initially.
- Learned about nvim plugin ecosystem
- Explored vim APIs
You tell me!
Hit the β button if you found this useful.
