                       (make-local-variable 'compile-command)
                       (format "make -f %s" (get-closest-pathname)))))
 
-(add-hook 'c++-mode-hook 'irony-mode)
-(add-hook 'c-mode-hook 'irony-mode)
-(add-hook 'objc-mode-hook 'irony-mode)
-
-(require 'company-irony-c-headers)
-;; load with `irony-mode` as a grouped backend
-(eval-after-load 'company
-  '(add-to-list
-    'company-backends '(company-irony-c-headers company-irony)))
-
-(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
-(add-hook 'irony-mode-hook #'irony-eldoc)
-
 ;; always use the latest & greatest
-(add-hook 'c++-mode-hook (lambda () (setq flycheck-gcc-language-standard "c++17")))
-(add-hook 'c++-mode-hook (lambda () (setq flycheck-clang-language-standard "c++17")))
-
-(eval-after-load 'flycheck
-  '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))
+(add-hook 'c++-mode-hook
+          (lambda () (setq
+                       flycheck-gcc-language-standard "c++17"
+                       flycheck-clang-language-standard "c++17")))
+
+(with-eval-after-load 'flycheck
+  '(add-hook 'flycheck-mode-hook 'flycheck-irony-setup))
 
 ;; disassemble C/C++ code under cursor
 ;; TODO: https://github.com/jart/disaster/issues/13

                 " "))
      (advice-add 'projectile-get-ext-command :override #'advice-projectile-use-rg)))

(setq projectile-globally-ignored-directories
      (append '(
        ".git"
        ".svn"
        "out"
        "repl"
        "project"
        "target"
        "venv") projectile-globally-ignored-directories))
(setq projectile-globally-ignored-files
      (append '(
        ".DS_Store"
        "TAGS"
        "*.gz"
        "*.pyc"
        "*.jar"
        "*.tar.gz"
        "*.tgz"
        "*.zip") projectile-globally-ignored-files))

;; use projectile everywhere
(projectile-mode)

;; flycheck ;;
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc))
(global-flycheck-mode 1)

;; yasnippet ;;

(require 'yasnippet)
(setq yas-snippet-dirs
      '("~/.emacs.d/snippets"
        "~/.emacs.d/yasnippet-snippets"))
(yas-global-mode 1)

;; rust ;;

(require 'rust-mode)

(add-hook 'rust-mode-hook #'racer-mode)
(add-hook 'racer-mode-hook #'eldoc-mode)
(add-hook 'racer-mode-hook #'company-mode)

(define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
(setq company-tooltip-align-annotations t)

(add-hook 'rust-mode-hook
          (lambda ()
            (local-set-key (kbd "C-c <tab>") #'rust-format-buffer)))

(add-to-list 'auto-mode-alist '("\\.lalrpop\\'" . rust-mode))

;; ocaml, reason, merlin ;;

;; setup / init merlin

;; highlight the current line in the buffer
(global-hl-line-mode 1)


;; what the fuck is this shit ?
;; (rich-minority-mode 1)
;; (setq rm-blacklist '(" GitGutter" " MRev" " company" " mate" " Projectile"))

;; (add-hook 'prog-mode-hook #'highlight-indentation-mode)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
(add-hook 'prog-mode-hook 'idle-highlight-mode)

;; winner-mode ;;

;; restore split pane config, winner-undo, winner-redo
(winner-mode 1)

(when (executable-find "rg")
  (progn
