                           (-> marker marker-position goto-char)
                           (recenter 2))))))
 
+;;; Projectile Integration
+
+;; Not working yet, in progress
+
+(defun oi--use-file? (FILE)
+  "Add outlines in FILE to current prompt?"
+  (let ((exts '("el")))
+    (or
+     (member (file-name-extension FILE) exts)
+     (string= FILE ".spacemacs"))))
+
+(defun oi-projectile-files ()
+  "Collect files for oi-projectile-jump."
+  (with-dir (projectile-project-root)
+            (-filter 'oi--use-file?
+                     (projectile-get-repo-files))))
+
+(defun oi-projectile-collect-outlines ()
+  "Collect all outlines in repo files."
+  ;; (--mapcat
+  ;;  (with-temp-buffer
+  ;;    (setq oi--current-buffer it)
+  ;;    (insert-file-contents it)
+  ;;    (emacs-lisp-mode)
+  ;;    (oi-collect-outlines)))
+  ;;  (oi-projectile-files))
+  (save-window-excursion
+      (--mapcat
+       (progn
+         (find-file it)
+         (oi-collect-outlines))
+       (oi-projectile-files))))
+
+(defun oi-projectile-jump ()
+  (interactive)
+  (let ((ivy-height oi-height))
+    (ivy-read "Outline " (oi-projectile-collect-outlines)
+              :preselect (oi--preselect)
+              :update-fn 'oi--remap-ivy-match-face
+              :action (-lambda ((_ . marker))
+                        (with-ivy-window
+                          (-> marker marker-buffer switch-to-buffer)
+                          (goto-char marker)
+                          (recenter 2))))))
+
+;; (oi-projectile-jump)
+
 (provide 'outline-ivy)

(require 'dash)
(require 'ivy)
(require 'outshine)

;;; Config


            (name (oi-format-name-pretty str parents level)))
      (when level
        (setq oi--parents-plist (plist-put oi--parents-plist level str)))
      ;; (--> (point-marker)
      ;;    (set-marker it (marker-position it) oi--current-buffer)
      ;;    (cons name it)
      ;;    (when level it)))))
      (->> (point-marker)
         (cons name)
         (when level)))))
