GithubHelp home page GithubHelp logo

pretty-magit's Introduction

assets/magit-transition.gif

This package brings in the functionality to replace important keywords in a Git message’s header with icons specified by text properties of your choice. This package is meant to work in line with the Git message conventions as laid out in “Conventional Commits” https://www.conventionalcommits.org/

A typical Git message should be of the form where the text in angled brackets are the default names for sections of the Git message:

<type>(<scope>): <subject>
--BLANK LINE--
<body>
--BLANK LINE--
<footer>

Installation

To be able to use this package, fonts with icon support is required. A good, free font that covers most icons that you would need is Source Code Pro.

On Spacemacs, you can install this by adding the following to dotspacemacs-additional-packages:

(setq-default
 ...
 dotspacemacs-additional-packages
 '(...
   (pretty-magit :location (recipe
                            :fetcher github
                            :repo "arifer612/pretty-magit"))
   ...))

Example configuration

The following configuration is an example that I use. It covers most of the general header types that are recommended in Conventional Commits.

(use-package pretty-magit
  :after magit
  :hook (magit-mode . pretty-magit-mode)
  :config
  (pretty-magit-add-rule
   '((build
      :desc "Changes that affect the build system or external dependencies."
      :icon ?
      :props (:foreground "#00008B" :height 1.2))
     (chore
      :desc "Updating grunt tasks."
      :icon ?
      :props (:foreground "#F5F5DC" :height 1.2))
     (ci
      :desc "Changes to CI configuration files and scripts."
      :icon ?
      :props (:foreground "#008080" :height 1.2))
     (docs
      :desc "Documentation only changes."
      :icon ?
      :props (:foreground "#A1f757" :height 1.2))
     (feat
      :desc "A new feature."
      :icon ?
      :props (:foreground "#8D012F" :height 1.2))
     (fix
      :desc "A bug fix."
      :icon ?
      :props (:foreground "#FB6542" :height 1.2))
     (perf
      :desc "A code change that improves performance."
      :icon ?
      :props (:foreground "#607D8B" :height 1.2))
     (refactor
      :desc "A code changes that neither fixes a bug nor adds a feature."
      :icon ?פּ
      :props (:foreground "#F5F5F5" :height 1.2))
     (revert
      :desc "For commits that reverts previous commit(s)."
      :icon ?
      :props (:foreground "#FDFD96" :height 1.2))
     (style
      :desc "Changes that do not affect the meaning of the code."
      :icon ?
      :props (:foreground "#FFFF3D" :height 1.2))
     (test
      :desc "Adding missing tests or correcting existing tests."
      :icon ?
      :props (:foreground "#FAAED2" :height 1.2)))))

pretty-magit's People

Contributors

arifer612 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.