Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danilshvalov/git-commit-ts-mode
A tree-sitter based major mode for editing Git commit messages in GNU Emacs.
https://github.com/danilshvalov/git-commit-ts-mode
emacs git tree-sitter
Last synced: 29 days ago
JSON representation
A tree-sitter based major mode for editing Git commit messages in GNU Emacs.
- Host: GitHub
- URL: https://github.com/danilshvalov/git-commit-ts-mode
- Owner: danilshvalov
- License: gpl-3.0
- Created: 2024-05-12T17:14:32.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-22T18:15:14.000Z (4 months ago)
- Last Synced: 2024-09-27T10:22:41.338Z (about 1 month ago)
- Topics: emacs, git, tree-sitter
- Language: Emacs Lisp
- Homepage:
- Size: 23.4 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-commit-ts-mode
A tree-sitter based major mode for editing Git commit messages in GNU Emacs.
![git-commit-ts-mode](https://github.com/danilshvalov/git-commit-ts-mode/assets/57654917/b5292190-651d-4794-abe1-6ac9702142ec)
## Quick start
### Grammar installation
Evaluate the Lisp code below:
```elisp
(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](https://github.com/gbprod/tree-sitter-gitcommit).### Package installation
If you use [elpaca](https://github.com/progfolio/elpaca) and [use-package](https://github.com/jwiegley/use-package) to manage packages in Emacs, use the following code to install `git-commit-ts-mode`:
```elisp
(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:
```elisp
(setq git-commit-major-mode 'git-commit-ts-mode)
```