 Taken from http://stackoverflow.com/a/3072831/355252."
     (interactive)
     (let ((inhibit-read-only t))
-      (ansi-color-apply-on-region compilation-filter-start (point-max))))
-
-  (add-hook 'compilation-filter-hook #'user-colorize-compilation-buffer)
-  (add-hook 'compilation-mode-hook #'user-results-buffer-hook))
+      (ansi-color-apply-on-region compilation-filter-start (point-max)))))
 
 (use-package multi-term :ensure t
   :if (eq system-type 'gnu/linux)


(use-package web-mode :ensure t
  :defer t
  :mode
  (("\\.phtml\\'" . web-mode)
   ("\\.tpl\\.php\\'" . web-mode)


;; generic programming
(use-package lsp-mode :ensure t
  :hook (ls-after-open . lsp-enable-imenu)
  :init
  (csetq lsp-highlight-symbol-at-point nil)

  :config
  (use-package company-lsp :ensure t
    :hook (lsp-mode . user-lsp-mode-hook)
    :init
    (csetq company-lsp-async t)
    (csetq company-lsp-cache-candidates nil)
    (csetq company-lsp-enable-recompletion t)
    (defun user-lsp-mode-hook ()
      (add-to-list 'company-backends 'company-lsp)))

  (use-package lsp-ui :ensure t
    :hook (lsp-mode . lsp-ui-mode)
    :init
    ;; Disable type information shown in sideline (enable it per mode if needed)
    ;; Allow it to display linting errors only.
    (csetq lsp-ui-sideline-show-hover nil)
    (csetq lsp-ui-sideline-show-symbol nil)

    (csetq lsp-ui-flycheck-live-reporting nil)))

(use-package xref
  :init
  (add-to-list 'xref-prompt-for-identifier 'xref-find-references t))

(use-package origami :ensure t
  :hook (prog-mode . origami-mode)
  :bind (("C-x n n" . origami-forward-toggle-node)
         ("C-x n t" . origami-recursively-toggle-node)
         ("C-x n a" . origami-toggle-all-nodes)
