Skip to content

Instantly share code, notes, and snippets.

@mbriggs
Created April 4, 2014 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbriggs/9975431 to your computer and use it in GitHub Desktop.
Save mbriggs/9975431 to your computer and use it in GitHub Desktop.
switch to project dir
(defun switch-to-local-project ()
(interactive)
(let* ((prompt "Switch to project: ")
(project-dir "~/src")
(choices (actionable-files-in-directory project-dir))
(project (ido-completing-read prompt choices nil t)))
(find-file (concat project-dir "/" project))))
(defun actionable-files-in-directory (dir)
(let ((files (directory-files dir))
(blacklist '(".DS_Store" "." "..")))
(-difference files blacklist)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment