From 980bee8e14c25f77c5e73255b482a34ebae865fe Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sat, 2 Sep 2017 08:00:45 +0100 Subject: [PATCH] Add flycheck and highlights --- modules/programming.el | 45 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/modules/programming.el b/modules/programming.el index 0e54716..961229a 100644 --- a/modules/programming.el +++ b/modules/programming.el @@ -19,6 +19,10 @@ (setq init-packages/programming-packages '(company + flycheck + flycheck-pos-tip + highlight-numbers + highlight-symbol racer rust-mode yasnippet) @@ -39,6 +43,39 @@ :config (setq company-backends (delete 'company-clang company-backends))) + ;; -------------------------------------------------------------------------- + ;; Flycheck mode. + ;; -------------------------------------------------------------------------- + + (use-package flycheck + :defer t + :init + (add-hook 'after-init-hook #'global-flycheck-mode) + :config + (require 'flycheck-pos-tip) + (flycheck-pos-tip-mode)) + + ;; -------------------------------------------------------------------------- + ;; Highlights. + ;; -------------------------------------------------------------------------- + + (use-package highlight-numbers + :init + (add-hook 'prog-mode-hook 'highlight-numbers-mode)) + + (use-package highlight-symbol + :init + (highlight-symbol-nav-mode) + (add-hook 'prog-mode-hook (lambda () (highlight-symbol-mode))) + (add-hook 'org-mode-hook (lambda () (highlight-symbol-mode))) + :bind + (("M-n" . highlight-symbol-next) + ("M-p" . highlight-symbol-prev)) + :config + (setq highlight-symbol-idle-delay 0.2 + highlight-symbol-on-navigation-p t)) + + ;; -------------------------------------------------------------------------- ;; Configure Rust environment. ;; -------------------------------------------------------------------------- @@ -112,14 +149,6 @@ (add-hook 'makefile-mode-hook 'makefile-mode-tabs) - ;; -------------------------------------------------------------------------- - ;; Ediff. - ;; -------------------------------------------------------------------------- - - (setq ediff-diff-options "-w" - ediff-split-window-function 'split-window-horizontally - ediff-window-setup-function 'ediff-setup-windows-plain) - ;; -------------------------------------------------------------------------- ;; Line numbers. ;;