Skip to content

zerbiniandrea/conventional-commits.nvim

Repository files navigation

Conventional Commits Plugin for Neovim

Gitmoji Conventional Commits Ko-fi

Create beautiful, standardized commits using Conventional Commits and Gitmojis directly from Neovim.

Demo

recorded with asciinema, some emojis are looking weird :(

Features

  • 🔍 Fuzzy search for commit types and emojis
  • 👀 Preview before committing
  • 📝 Full vim-style editing
  • 🎯 No dependencies

Installation

Using lazy.nvim

{
  'zerbiniandrea/conventional-commits.nvim',
  cmd = 'ConventionalCommit',
  config = function()
    require('conventional-commits').setup({
      -- Optional configuration here
    })
  end,
  keys = {
    { '<leader>gc', '<cmd>ConventionalCommit<cr>', desc = 'Conventional Commit' },
  },
}

Using other plugin managers

The plugin follows standard Neovim plugin structure and should work with any plugin manager.

Usage

:ConventionalCommit

Default keymap: <leader>gc

Configuration

require('conventional-commits').setup({
  show_emoji_step = true,  -- Show emoji selection step
  show_preview = true,     -- Show preview before committing
  border = 'rounded',      -- Border style ('rounded', 'single', 'double', 'solid')

  -- Customize commit types
  commit_types = {
    { key = 'feat', description = 'A new feature' },
    { key = 'fix', description = 'A bug fix' },
    { key = 'docs', description = 'Documentation changes' },
    { key = 'refactor', description = 'Code refactoring' },
    -- Add your own types...
  },

  -- Emojis are loaded from gitmojis.json
  -- Override if you want custom emojis:
  -- emojis = { { key = '✨', name = 'sparkles', description = 'new feature' } },
})

Keybindings

  • Type to filter (fuzzy search), / or Ctrl-n/Ctrl-p to navigate
  • <CR> to select, <Esc> to cancel

About

A nvim plugin to manage conventional commits with gitmojis

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors