+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster startup; ~5-20% general boost + reduce consing, function calls & garbage collection by preferring cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and various cl-lib filter/map/reduce functions) -- where possible + prefer functions with dedicated opcodes, like assq (see byte-defop's in bytecomp.el for more) + prefer pcase & cond (faster) over cl-case + general refactor for code readability + ensure naming & style conventions are adhered to + appease byte-compiler by marking unused variables with underscore + defer minor mode activation to after-init, emacs-startup or window-setup hooks; a customization opportunity for users + ensures custom functionality won't interfere with startup.
29 lines
923 B
EmacsLisp
29 lines
923 B
EmacsLisp
;;; feature/syntax-checker/config.el -*- lexical-binding: t; -*-
|
|
|
|
;; pkg-info doesn't get autoloaded when `flycheck-version' needs it, so we do
|
|
;; it ourselves:
|
|
(autoload 'pkg-info-version-info "pkg-info")
|
|
|
|
(def-package! flycheck
|
|
:commands (flycheck-mode flycheck-list-errors flycheck-buffer)
|
|
:config
|
|
;; Emacs feels snappier without checks on idle/change
|
|
(setq flycheck-check-syntax-automatically '(save mode-enabled))
|
|
|
|
(set! :popup 'flycheck-error-list-mode :select t :autokill t)
|
|
|
|
(after! evil
|
|
;; Flycheck buffer on ESC in normal mode.
|
|
(defun +syntax-checkers|flycheck-buffer ()
|
|
(when flycheck-mode
|
|
(ignore-errors (flycheck-buffer))
|
|
nil))
|
|
(add-hook '+evil-esc-hook #'+syntax-checkers|flycheck-buffer t)))
|
|
|
|
|
|
(def-package! flycheck-pos-tip
|
|
:after flycheck
|
|
:config
|
|
(setq flycheck-pos-tip-timeout 10
|
|
flycheck-display-errors-delay 0.5)
|
|
(flycheck-pos-tip-mode +1))
|