diff options
-rw-r--r-- | emacs/.emacs.d/init.org | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index e7cbedc7..0f43c846 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -482,16 +482,21 @@ based upon some folder conventions I use. :config (progn (projectile-global-mode) (add-to-list 'projectile-globally-ignored-directories ".stversions") - (defun ap/subfolder-projects (dir) - (--map (file-relative-name it dir) - (-filter (lambda (subdir) - (--reduce-from (or acc (funcall it subdir)) nil - projectile-project-root-files-functions)) - (-filter #'file-directory-p (directory-files dir t "\\<"))))) + + (defun directory-directories (dir) + (seq-filter #'file-directory-p + (directory-files dir t (rx string-start + (char alnum))))) + + (defun project-directories (start-dir) + (seq-map (lambda (x) (file-relative-name x start-dir)) + (seq-mapcat #'directory-directories + (seq-mapcat #'directory-directories + (directory-directories start-dir))))) (defun ap/open-subfolder-project (from-dir &optional arg) (let ((project-dir (projectile-completing-read "Open project: " - (ap/subfolder-projects from-dir)))) + (project-directories from-dir)))) (projectile-switch-project-by-name (expand-file-name project-dir from-dir) arg))) (defun yarn-install (&optional arg) |