From 3786324d3bf8c25e44245356e0ddd66a69303fd4 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 1 May 2020 18:30:17 +0300 Subject: Change: flycheck for on-the-fly syntax checking, and its rust config --- emacs.d/custom.el | 14 ++++++++++++++ emacs.d/init.el | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/emacs.d/custom.el b/emacs.d/custom.el index e69de29..f10d685 100644 --- a/emacs.d/custom.el +++ b/emacs.d/custom.el @@ -0,0 +1,14 @@ +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(package-selected-packages + (quote + (flycheck-inline flycheck-pos-tip flycheck-color-mode-line yaml-mode tabbar session rust-mode pod-mode muttrc-mode mutt-alias markdown-mode magit initsplit htmlize graphviz-dot-mode go-mode folding eproject diminish debian-el csv-mode browse-kill-ring boxquote bm bar-cursor apache-mode use-package modus-operandi-theme flycheck)))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/emacs.d/init.el b/emacs.d/init.el index e5aba48..55479d9 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -50,15 +50,22 @@ (add-to-list 'auto-mode-alist '("README" . markdown-mode)) (add-to-list 'auto-mode-alist '("\\.mdwn\\'" . markdown-mode))) -(use-package flycheck - :init (global-flycheck-mode)) - (use-package modus-operandi-theme :config (setq modus-operandi-theme-slanted-constructs t) (setq modus-operandi-theme-bold-constructs t) (load-theme 'modus-operandi t)) +(use-package flycheck) + +(use-package flycheck-rust) +(with-eval-after-load 'rust-mode + (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)) + +(use-package flycheck-color-mode-line) +(eval-after-load 'flycheck + '(add-hook 'flycheck-mode-hook 'flycheck-color-mode-line-mode)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -136,6 +143,26 @@ :foreground "#ff0000") +;; Turn on flycheck mode for program code. +(require 'flycheck) +(add-hook 'prog-mode-hook 'flycheck-mode) +(setq flycheck-idle-delay 0.25) +(setq flycheck-check-syntax-automatically + '(save idle-change new-line idle-buffer-switch mode-enabled)) +(set-face-attribute 'flycheck-error nil + :weight 'bold + :underline "#ff0000" + :foreground "#ff0000") + +;;(require 'flymake) +;;(add-hook 'prog-mode-hook 'flymake-mode) +;;(add-hook 'prog-mode-hook 'flymake-mode) +;;(set-face-attribute 'flymake-error nil +;; :underline "#ff0000" +;; :foreground "#ff0000") + + + ;; Show matching parens. (add-hook 'text-mode-hook 'show-paren-mode) (add-hook 'prog-mode-hook 'show-paren-mode) -- cgit v1.2.1