From 715a9d2b7d322406f81258c1e0a144c5ce4e3072 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 21 Feb 2024 14:14:54 +0000 Subject: [PATCH] Add buffer shortcuts for Documents, Downloads and Projects directories --- config/buffers.org | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/config/buffers.org b/config/buffers.org index 49a1b25..e1ca59e 100644 --- a/config/buffers.org +++ b/config/buffers.org @@ -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