Add buffer shortcuts for Documents, Downloads and Projects directories

This commit is contained in:
Evie Litherland-Smith 2024-02-21 14:14:54 +00:00
parent d3bc9622fb
commit 715a9d2b7d

View file

@ -63,3 +63,29 @@
(find-file (expand-file-name "feeds.org" elfeed-base-directory))))
(keymap-global-set "C-c w f" #'my/open-feeds-file)
#+end_src
** Documents and Downloads
#+begin_src emacs-lisp
(defun my/open-documents-directory ()
"Open Documents directory"
(interactive)
(find-file "~/Documents/"))
(defun my/open-downloads-directory ()
"Open Downloads directory"
(interactive)
(find-file "~/Downloads/"))
(keymap-global-set "C-c w d" #'my/open-documents-directory)
(keymap-global-set "C-c w C-d" #'my/open-downloads-directory)
#+end_src
** Projects directory
#+begin_src emacs-lisp
(with-eval-after-load 'magit
(defun my/open-projects-directory ()
"Open Projects directory.
Try `magit-clone-default-directory' if available, fall back to
~/Projects otherwise."
(interactive)
(find-file (if magit-clone-default-directory
magit-clone-default-directory
"~/Projects/")))
(keymap-global-set "C-c w p" #'my/open-projects-directory))
#+end_src