single hook with use-package

This commit is contained in:
Jesús 2019-01-31 22:20:21 -05:00
parent 719257e801
commit 257849faab
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766
6 changed files with 32 additions and 32 deletions

View File

@ -6,10 +6,10 @@
;; emmet-mode
(use-package emmet-mode
;; Enable for only languages
:init
(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes
(add-hook 'web-mode-hook 'emmet-mode) ;; enable Emmet on web-mode
(add-hook 'css-mode-hook 'emmet-mode) ;; enable Emmet's css abbreviation.
:hook
(sgml-mode . emmet-mode) ;; Auto-start on any markup modes
(web-mode . emmet-mode) ;; enable Emmet on web-mode
(css-mode . emmet-mode) ;; enable Emmet's css abbreviation.
)
(provide 'init-emmet-mode)

View File

@ -3,17 +3,7 @@
;;
;;; Code:
(use-package flycheck
;; Enable for only languages
:init
;; (add-hook 'after-init-hook 'global-flycheck-mode)
(add-hook 'c++-mode-hook 'flycheck-mode)
;; (add-hook 'emacs-lisp-mode-hook 'flycheck-mode)
(add-hook 'html-mode-hook 'flycheck-mode)
(add-hook 'js-mode-hook 'flycheck-mode)
(add-hook 'web-mode-hook 'flycheck-mode)
(add-hook 'sh-mode-hook 'flycheck-mode)
:config
;; support web-mode with PHP
(flycheck-define-checker mix-php
@ -27,7 +17,14 @@
:modes (php-mode php+-mode web-mode))
(add-to-list 'flycheck-checkers 'mix-php)
)
;; Enable for only languages
:hook
(c++-mode . flycheck-mode)
;; (emacs-lisp-mode flycheck-mode)
(html-mode . flycheck-mode)
(js-mode . flycheck-mode)
(web-mode . flycheck-mode)
(sh-mode . flycheck-mode))
(provide 'init-flycheck)

View File

@ -69,7 +69,8 @@
:ensure t
:mode ("/\\.?git/?config$"
"/\\.gitmodules$")
:init (add-hook 'gitconfig-mode-hook 'flyspell-mode))
:hook
(gitconfig-mode . flyspell-mode))
(use-package gitignore-mode
:ensure t

View File

@ -17,14 +17,16 @@
:config
(linum-mode 1)
:hook
(apache-mode . linum-mode)
(elisp-mode . linum-mode)
(html-mode . linum-mode)
(js-mode . linum-mode)
(apache-mode . linum-mode)
(elisp-mode . linum-mode)
(html-mode . linum-mode)
(js-mode . linum-mode)
(less-mode . linum-mode)
(markdown-mode . linum-mode)
(nginx-mode . linum-mode)
(php-mode . linum-mode)
(web-mode . linum-mode))
(nginx-mode . linum-mode)
(php-mode . linum-mode)
(sass-mode . linum-mode)
(web-mode . linum-mode))
(use-package hl-line)

View File

@ -6,8 +6,8 @@
(use-package php-refactor-mode
:after (php-mode)
:mode ("\\.php\\'" . php-mode)
:config
(add-hook 'php-mode-hook 'php-refactor-mode))
:hook
(php-mode . php-refactor-mode))
(use-package php-mode
:ensure t)

View File

@ -5,13 +5,13 @@
;;; Code:
;; rainbow-mode
(use-package rainbow-mode
:init
(add-hook 'css-mode-hook 'rainbow-mode)
(add-hook 'sass-mode-hook 'rainbow-mode)
(add-hook 'scss-mode-hook 'rainbow-mode)
(add-hook 'less-mode-hook 'rainbow-mode)
(add-hook 'web-mode-hook 'rainbow-mode)
(add-hook 'html-mode-hook 'rainbow-mode))
:hook
(css-mode . rainbow-mode)
(sass-mode . rainbow-mode)
(scss-mode . rainbow-mode)
(less-mode . rainbow-mode)
(web-mode . rainbow-mode)
(html-mode . rainbow-mode))
(provide 'init-rainbow)
;;; init-rainbow.el ends here