Skip to content

A tree-sitter based major mode for editing Git commit messages in GNU Emacs.

License

Notifications You must be signed in to change notification settings

danilshvalov/git-commit-ts-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

git-commit-ts-mode

A tree-sitter based major mode for editing Git commit messages in GNU Emacs.

git-commit-ts-mode

Quick start

Grammar installation

Evaluate the Lisp code below:

(add-to-list 'treesit-language-source-alist
             '(gitcommit . ("https://github.com/gbprod/tree-sitter-gitcommit")))

Running M-x treesit-install-language-grammar [RET] gitcommit will compile and install the latest tree-sitter-gitcommit.

Package installation

If you use elpaca and use-package to manage packages in Emacs, use the following code to install git-commit-ts-mode:

(use-package git-commit-ts-mode
  :elpaca (git-commit-ts-mode :host github
                              :repo "danilshvalov/git-commit-ts-mode")
  :mode "\\COMMIT_EDITMSG\\'")

Configuration

Max commit message size

To specify the maximum allowed message size, use the git-commit-ts-max-message-size variable (default value is 72). If the specified limit is exceeded, the rest of the message will be highlighted using git-commit-ts-overflow-face.

Magit integration

To use git-commit-ts-mode in the Magit commit buffer, you need to change the value of the git-commit-major-mode variable, for example, as follows:

(setq git-commit-major-mode 'git-commit-ts-mode)

About

A tree-sitter based major mode for editing Git commit messages in GNU Emacs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published