Emacs: use-package: use :hook
This commit is contained in:
parent
077bc92c1f
commit
c91549b926
1 changed files with 17 additions and 13 deletions
|
@ -239,8 +239,8 @@
|
||||||
;; org-bullets
|
;; org-bullets
|
||||||
;; Show bullets in org-mode as UTF-8 characters
|
;; Show bullets in org-mode as UTF-8 characters
|
||||||
(use-package org-bullets
|
(use-package org-bullets
|
||||||
:config
|
:hook
|
||||||
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
|
(org-mode-hook . (lambda () (org-bullets-mode 1))))
|
||||||
|
|
||||||
;; undo-tree
|
;; undo-tree
|
||||||
;; Treat undo history as a tree
|
;; Treat undo history as a tree
|
||||||
|
@ -333,8 +333,9 @@
|
||||||
(use-package mu4e-alert
|
(use-package mu4e-alert
|
||||||
:config
|
:config
|
||||||
(mu4e-alert-set-default-style 'libnotify)
|
(mu4e-alert-set-default-style 'libnotify)
|
||||||
(add-hook 'after-init-hook #'mu4e-alert-enable-notifications)
|
:hook
|
||||||
(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display))
|
((after-init-hook . mu4e-alert-enable-notifications)
|
||||||
|
(after-init-hook . mu4e-alert-enable-mode-line-display)))
|
||||||
|
|
||||||
;; indent-guide
|
;; indent-guide
|
||||||
;; show vertical lines to guide indentation
|
;; show vertical lines to guide indentation
|
||||||
|
@ -429,7 +430,7 @@
|
||||||
(use-package diff-hl
|
(use-package diff-hl
|
||||||
:config
|
:config
|
||||||
(global-diff-hl-mode t)
|
(global-diff-hl-mode t)
|
||||||
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh))
|
:hook (magit-post-refresh-hook . diff-hl-magit-post-refresh))
|
||||||
|
|
||||||
;; treemacs
|
;; treemacs
|
||||||
;; A tree style file explorer package
|
;; A tree style file explorer package
|
||||||
|
@ -613,12 +614,13 @@
|
||||||
;; company-math
|
;; company-math
|
||||||
;; Completion backends for unicode math symbols and latex tags
|
;; Completion backends for unicode math symbols and latex tags
|
||||||
(use-package company-math
|
(use-package company-math
|
||||||
:config
|
:after (company tex)
|
||||||
(add-hook 'TeX-mode-hook (lambda ()
|
:hook (TeX-mode-hook . (lambda ()
|
||||||
(setq-local company-backends
|
(setq-local company-backends
|
||||||
(append '((company-math-symbols-latex company-latex-commands))
|
(append '((company-math-symbols-latex company-latex-commands))
|
||||||
company-backends)))))
|
company-backends)))))
|
||||||
|
|
||||||
|
|
||||||
;; beginend
|
;; beginend
|
||||||
;; Redefine M-< and M-> for some modes
|
;; Redefine M-< and M-> for some modes
|
||||||
(use-package beginend
|
(use-package beginend
|
||||||
|
@ -733,7 +735,7 @@
|
||||||
(setq whitespace-action '(auto-cleanup))
|
(setq whitespace-action '(auto-cleanup))
|
||||||
(setq whitespace-style '(trailing space-before-tab indentation empty space-after-tab))
|
(setq whitespace-style '(trailing space-before-tab indentation empty space-after-tab))
|
||||||
(setq coffee-tab-width 2)
|
(setq coffee-tab-width 2)
|
||||||
(add-hook 'coffee-mode-hook 'whitespace-mode))
|
:hook (coffee-mode-hook whitespace-mode))
|
||||||
|
|
||||||
;; python
|
;; python
|
||||||
;; Python's flying circus support for Emacs
|
;; Python's flying circus support for Emacs
|
||||||
|
@ -1043,10 +1045,11 @@
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
;; Run prog mode hooks for bibtex
|
;; Run prog mode hooks for bibtex
|
||||||
(add-hook 'bibtex-mode-hook (lambda () (run-hooks 'prog-mode-hook)))
|
|
||||||
|
|
||||||
;; Use a modern BibTeX dialect
|
;; Use a modern BibTeX dialect
|
||||||
(bibtex-set-dialect 'biblatex))
|
(bibtex-set-dialect 'biblatex))
|
||||||
|
;; Run prog mode hooks for bibtex
|
||||||
|
:hook (bibtex-mode-hook . (lambda () (run-hooks 'prog-mode-hook))))
|
||||||
|
|
||||||
;; reftex
|
;; reftex
|
||||||
;; TeX cross-reference management
|
;; TeX cross-reference management
|
||||||
|
@ -1085,4 +1088,5 @@
|
||||||
(ad-activate 'term-sentinel)
|
(ad-activate 'term-sentinel)
|
||||||
|
|
||||||
;; disable nlinum in shell
|
;; disable nlinum in shell
|
||||||
(add-hook 'term-mode-hook (lambda () (nlinum-mode -1))))
|
:hook (term-mode-hook . (lambda () (nlinum-mode -1)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue