;;; my-git --- configures git for emacs -*- lexical-binding: t -*- ;;; Commentary: ;;; Code: (add-to-list 'auto-mode-alist '("\\.gitconfig\\'" . gitconfig-mode)) (add-to-list 'auto-mode-alist '("\\.git/config\\'" . gitconfig-mode)) (add-to-list 'auto-mode-alist '("\\.gitmodules\\'" . gitconfig-mode)) (add-to-list 'auto-mode-alist '("\\.gitignore\\'" . gitconfig-mode)) (add-to-list 'auto-mode-alist '("\\.dockerignore\\'" . gitconfig-mode)) (add-to-list 'auto-mode-alist '("\\.gitattributes\\'" . gitattributes-mode)) (setq vc-follow-symlinks t) (global-set-key (kbd "C-x g") 'magit-status) (defun my/git-commit-auto-fill () "Ensures that the commit body does not exceed 72 characters." (setq-local fill-column 72) (setq-local comment-auto-fill-only-comments nil)) (add-hook 'git-commit-mode-hook 'my/git-commit-auto-fill) (customize-set-variable 'git-commit-summary-max-length 70) (global-set-key (kbd "C-c g l") 'git-link) (global-set-key (kbd "C-c g c") 'git-link-commit) (customize-set-variable 'git-link-open-in-browser 't) (provide 'my-git) ;;; my-git.el ends here