Skip to content

Instantly share code, notes, and snippets.

@iwinux
Last active December 10, 2015 06:29
Show Gist options
  • Save iwinux/4395118 to your computer and use it in GitHub Desktop.
Save iwinux/4395118 to your computer and use it in GitHub Desktop.
my-places.el - simple directory shortcut for Emacs
;; usage: M-x places-goto
(setq my-places
'((notes . "~/documents/notes")
(blog . "~/documents/blog")
(emacs . "~/.emacs.d")
(src . "~/src")
(projects . "~/src/projects")))
(defun places-goto ()
(interactive)
(let* ((key (intern (read-string "Go to place: ")))
(place (cdr (assoc key my-places))))
(when place
(cd place)
(message "current place: %s - %s" key place)
(when (fboundp 'sr-speedbar-open)
(unless (sr-speedbar-exist-p) (sr-speedbar-open))
(sr-speedbar-refresh)))))
(provide 'my-places)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment