Skip to content

Cassin01/cmp-gitcommit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

cmp-gitcommit

gitcommit source for nvim-cmp

cmp-gitcommit is a fork of cmp-conventionalcommits

gif

gif

Features

Features that cmp-gitcommit provides but cmp-conventionalcommits

  • no npm dependencies

Features that cmp-conventionalcommits provides but cmp-gitcommit

  • commitlint support
  • lerna support

⚠️ A shell command invoked incline

(cd {%p:h:h} && git ls-files)

If you are not POSIX compliant shell user, please make a request. I will deal with it.

Sources that this plugin provides

This plugin provides

  • types (ci: 👷, ci, ci:, etc)
  • scopes (Travisi, Circle, BrowserStack, etc)
  • tracked path object (README.md, src, .gitignore, etc)

sources for nvim-cmp

Usage

Packer

use 'hrsh7th/nvim-cmp'
use { 'Cassin01/cmp-gitcommit', after = { 'nvim-cmp' } }
require('cmp').setup {
  sources = require'cmp'.config.sources({{ name = 'gitcommit' }})
}

Configuration

use {
   -- ...
   config = function()
     require('cmp-gitcommit').setup({
       typesDict = {
         ci = {
           label = 'ci',
           emoji = '👷',
           documentation = 'Changes to our CI configuration files and scripts',
           scopes = {'Travisi', 'Circle', 'BrowserStack', 'SauceLabs'} -- FEATURE custom scopes !!
         }
         style = {
           label = 'style',
           emoji = '🎨',
           documentation = 'Changes that do not affect the meaning of the code',
         }
         test = {
           label = 'test',
           emoji = '🚨',
           documentation = 'Adding missing tests or correcting existing tests',
         }
         -- ...
       }
       insertText = function(label, emoji) return label .. ":" .. emoji .. ' ' end
     })
   end
}