diff options
author | Alan Pearce | 2017-04-24 19:34:02 +0200 |
---|---|---|
committer | Alan Pearce | 2017-04-24 19:34:02 +0200 |
commit | 819d7f6ea51d9b1b52b3f283e6b9193dcd5f46e6 (patch) | |
tree | 77e2497374155eb15a30ff0ed21ba33567a6a4d1 /emacs | |
parent | 7f7087d808a6e441e6c3aa36aa8328e93f63d256 (diff) | |
download | nixfiles-819d7f6ea51d9b1b52b3f283e6b9193dcd5f46e6.tar.lz nixfiles-819d7f6ea51d9b1b52b3f283e6b9193dcd5f46e6.tar.zst nixfiles-819d7f6ea51d9b1b52b3f283e6b9193dcd5f46e6.zip |
Emacs: Simplify project opening logic
Use ghq to do the heavy lifting
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/init.org | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 58300552..84609ac2 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -479,22 +479,6 @@ based upon some folder conventions I use. (projectile-global-mode) (add-to-list 'projectile-globally-ignored-directories ".stversions") - (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: " - (project-directories from-dir)))) - (projectile-switch-project-by-name (expand-file-name project-dir from-dir) arg))) - (defun yarn-install (&optional arg) (interactive "P") (projectile-with-default-dir (projectile-project-root) @@ -517,7 +501,11 @@ based upon some folder conventions I use. (defun ap/open-project (&optional arg) (interactive "P") - (ap/open-subfolder-project projects-root-directory arg)) + (let ((project-dir (projectile-completing-read + "Open project: " + (ghq--find-projects)))) + (projectile-switch-project-by-name + (expand-file-name project-dir (ghq--find-root)) arg))) (setq projectile-switch-project-action #'projectile-commander projectile-completion-system 'ivy))) |