-;; Time-stamp: <2014-11-19 11:10:31 kmodi>
+;; Time-stamp: <2014-11-20 09:15:03 kmodi>
 
 ;; Projectile
 ;; Source: https://github.com/bbatsov/projectile

                                        ; string (\0); ag returns newline (\n)
                                        ; separated list; So pipe the `ag' output
                                        ; to `tr' and replace all \n with \0.
                                        ))
    (defun projectile-get-ext-command ()
      "Override the projectile-defined function so that `ag' is always used for
getting a list of all files in a project."
      projectile-ag-command)
    (setq projectile-ignored-projects `(,(concat (getenv "HOME") "/"))) ; Don't consider my home dir as a project
    (defun projectile-cache-files-find-file-hook ()
      "Function for caching files with `find-file-hook'."
      (when (and projectile-enable-caching
                 (projectile-project-p)
                 (not (member (projectile-project-p) (projectile-ignored-projects))))
        (projectile-cache-current-file)))
    ;; (setq projectile-enable-caching nil)
    (setq projectile-enable-caching t) ; Enable caching, otherwise
                                        ; `projectile-find-file' is really slow
                                        ; for large projects
    (add-to-list 'projectile-project-root-files-bottom-up ".SOS")
    (dolist (item '(".SOS" "nobackup"))
      (add-to-list 'projectile-globally-ignored-directories item))
    (dolist (item '("GTAGS" "GRTAGS" "GPATH"))

    ;; Customize the Projectile mode-line lighter
    ;; (setq projectile-mode-line '(:eval (format " Projectile[%s]" (projectile-project-name))))
    (setq projectile-mode-line " Prj")

    (bind-keys
     :map modi-mode-map
     ("s-f s-f" . projectile-find-file)) ;; Win-f Win-f

    ;; Globally enable Projectile
    (projectile-global-mode)))

