 (require 'clang-format)
 (fset 'c-indent-region 'clang-format-region)
 
+(defun my-goto-symbol ()
+  (interactive)
+  (save-buffer)
+  (deactivate-mark)
+  (xref-push-marker-stack)
+  (or (and *rtags*
+           (rtags-is-indexed)
+           (rtags-find-symbol-at-point))
+      (dumb-jump-go)))
+
 (bind-keys :map c-mode-base-map
            ("<C-tab>" . company-complete)
            ("C-M-\\" . clang-format-region)
            ("C-i" . clang-format)
-           ("C-." . helm-imenu)
+           ("C-." . my-imenu)
+           ("M-." . my-goto-symbol)
+           ("M-," . xref-pop-marker-stack)
            ("M-o" . cff-find-other-file))
+
+(when *rtags*
+  (bind-key "M-?" 'rtags-display-summary c-mode-base-map))
 
 (setq inf-clojure-program '("localhost" . 9999))   ;; "planck"
 (add-hook 'clojure-mode-hook 'inf-clojure-minor-mode)

           ("M-." . dumb-jump-go)
           ("M-," . 'dumb-jump-back))

(defun my-non-special-modes-setup ()
  (setq indicate-empty-lines t)
  (whitespace-mode)

                     dired-collapse
                     dired-rainbow
                     mu4e-alert
                     ;; lsp-mode
                     ;; cquery
                     elm-mode
                     ))

(setq *rtags* (file-exists-p "~/rtags/src"))
(when *rtags* (add-to-list 'load-path "~/rtags/src"))

(set-language-environment "czech")
(setq default-input-method "czech-qwerty")
