       helm-grep-file-path-style 'relative)
 ;; (setq helm-follow-mode-persistent t)
 
+(require 'projectile)
+(require 'helm-projectile)
+(setq projectile-enable-caching t
+      projectile-completion-system 'helm)
+(projectile-global-mode)
+(bind-key "C-x C-p" 'projectile-find-file)
+
+(defun my-helm-switch-buffer ()
+  (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-recentf
+                       helm-source-projectile-files-list
+                       helm-source-buffer-not-found)
+                   '(helm-source-buffers-list
+                     helm-source-recentf
+                     helm-source-buffer-not-found))
+        :buffer "*helm buffers*"
+        :keymap helm-buffer-map
+        :truncate-lines helm-buffers-truncate-lines))
+
 (bind-keys ("M-x" . helm-M-x)
-           ("C-x C-b" . helm-mini)
-           ("C-x b" . helm-mini)
+           ("C-x C-b" . my-helm-switch-buffer)
+           ("C-x b" . my-helm-switch-buffer)
            ("C-h a" . helm-apropos)
            ("C-x C-f" . helm-find-files)
            ("M-y" . helm-show-kill-ring)


(require 'recentf)
(recentf-mode 1)
(setq recentf-max-saved-items 150)
;; (add-to-list 'recentf-exclude "bookmarks")

(when *osx*

                     projectile
                     helm
                     helm-xref
                     helm-projectile
                     ;; helm-dired-history
                     helm-org-rifle
                     super-save
