   (interactive)
   (if (rtags-is-indexed)
       (rtags-imenu)
-    (imenu)))             ;; TODO: counsel-imenu-in-all-buffers -> imenu-anywhere (ivy)
+    (helm-imenu-in-all-buffers)))    ;; semantic-or-imenu nil
 
 (defun my-non-special-modes-setup ()
   (setq indicate-empty-lines t)

  (exec-path-from-shell-initialize)
  (setq python-shell-completion-native-enable nil))

(require 'ivy)
(ivy-mode 1)
(diminish 'ivy-mode)
(global-set-key (kbd "C-c C-r") 'ivy-resume)

(setq ivy-use-virtual-buffers t
      ivy-virtual-abbreviate 'full
      ivy-height 20
      ivy-initial-inputs-alist nil   ;; no regexp by default
      ivy-re-builders-alist  ;; allow input not in order
      '((t . ivy--regex-ignore-order))
      swiper-action-recenter t)

;; TODO: vystavit vlastni variantu ivy--virtual-buffers ktera namisto
;; bookmarks prida vysledek counsel-projectile--buffer-file-list

(require 'counsel)
(global-set-key (kbd "M-x") 'counsel-M-x)
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
(global-set-key (kbd "C-h a") 'counsel-apropos)
(global-set-key (kbd "M-i")
                (lambda ()
                  (interactive)
                  (swiper (thing-at-point 'symbol t))))
(global-set-key (kbd "M-y") 'counsel-yank-pop)
(global-set-key (kbd "M-G")
                (lambda ()
                  (interactive)
                  (counsel-ag (if (use-region-p)
                                  (buffer-substring-no-properties (region-beginning) (region-end))
                                (thing-at-point 'symbol t)))))

(define-key counsel-find-file-map (kbd "C-l") 'counsel-up-directory)

(require 'projectile)

(setq projectile-enable-caching t)

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

(add-hook 'text-mode-hook 'auto-fill-mode)
