 ;; (add-hook 'c-mode-hook 'electric-pair-local-mode)
 ;; (add-hook 'c++-mode-hook 'electric-pair-local-mode)
 
-(require 'helm-xref)
-(setq xref-show-xrefs-function 'helm-xref-show-xrefs)
+(require 'ivy-xref)
+(setq xref-show-xrefs-function 'ivy-xref-show-xrefs)
 
 (require 'smartparens-config)
 

(bind-key "M-g" '(lambda ()
                   (interactive)
                   (save-some-buffers t nil)
                   (helm-grep-ag (projectile-project-root) current-prefix-arg)))

(bind-key* "M-G" '(lambda ()
                    (interactive)
                    (save-some-buffers t nil)
                    (helm-grep-ag (helm-current-directory) current-prefix-arg)))

(bind-key "M-i" 'helm-occur-from-isearch isearch-mode-map)

(defun my-helm-projectile-buffers-list ()
  (interactive)
  (unless helm-source-buffers-list
    (setq helm-source-buffers-list
          (helm-make-source "Buffers" 'helm-source-buffers)))
  (helm :sources (if (projectile-project-p)
                     '(helm-source-buffers-list
                       helm-source-projectile-files-list
                       helm-source-buffer-not-found)
                   '(helm-source-buffers-list
                     helm-source-buffer-not-found))
        :buffer "*helm buffers*"
        :keymap helm-buffer-map
        :truncate-lines helm-buffers-truncate-lines))

(bind-keys ([remap list-buffers] . my-helm-projectile-buffers-list)
           ("M-x" . helm-M-x)
           ("C-x b" . my-helm-projectile-buffers-list)
           ("C-h a" . helm-apropos)
           ("C-x C-f" . helm-find-files)
           ("M-y" . helm-show-kill-ring)
           ("M-i" . helm-occur)
           ("C-c h" . helm-command-prefix)
           ("C-c <SPC>" . helm-all-mark-rings)
           ("C-c C-r" . helm-resume))

(require 'helm-ext)
(helm-ext-ff-enable-auto-path-expansion t)

(require 'shackle)
(setq shackle-rules

                    nil
                    :foreground "gray50")

(set-face-attribute 'font-lock-comment-face
                    nil
                    ;; :height 0.9
