                      dired-collapse
                      dired-rainbow
                      mu4e-alert
+                     lsp-mode
+                     cquery
                      ))
-
-(setq use-rtags (file-exists-p "~/rtags/src"))
-
-(when use-rtags
-  (add-to-list 'load-path "~/rtags/src"))
-
 
 (set-language-environment "czech")
 (setq default-input-method "czech-qwerty")

  (company-mode)
  ;; (semantic-mode 1)
  ;; (delete '(scheme-mode . semantic-default-scheme-setup) semantic-new-buffer-setup-functions)
  (bind-keys :map prog-mode-map
             ("<C-tab>" . company-complete)
             ("C-." . my-imenu)))

(add-hook 'text-mode-hook 'auto-fill-mode)
(add-hook 'text-mode-hook 'my-non-special-modes-setup)

(add-to-list 'cff-source-regexps '("\\.m$" . (lambda (base) (concat base ".m"))))
(add-to-list 'cff-source-regexps '("\\.mm$" . (lambda (base) (concat base ".mm"))))

(require 'cquery)
(setq cquery-executable (expand-file-name "~/cquery/build/release/bin/cquery"))   ;; https://github.com/cquery-project/cquery/wiki/Getting-started
(setq cquery-extra-init-params '(:index (:comments 2) :cacheFormat "msgpack"))
(setq cquery-sem-highlight-method nil)   ;; 'font-lock)

(require 'lsp-mode)
(setq lsp-highlight-symbol-at-point nil
      lsp-enable-flycheck nil
      lsp-enable-indentation nil
      lsp-enable-eldoc nil)

(add-hook 'c-mode-hook #'lsp-cquery-enable)
(add-hook 'c++-mode-hook #'lsp-cquery-enable)

(require 'lsp-imenu)
(add-hook 'lsp-after-open-hook 'lsp-enable-imenu)

(fset 'c-indent-region 'clang-format-region)

(bind-keys :map c-mode-base-map
           ("<C-tab>" . company-complete)
           ("C-M-\\" . clang-format-region)
           ("C-i" . clang-format)
           ("C-." . helm-imenu)
           ("M-o" . cff-find-other-file))

(setq inf-clojure-program '("localhost" . 9999))   ;; "planck"
(add-hook 'clojure-mode-hook 'inf-clojure-minor-mode)
