From 47f45957aa2efa021d19d4e9cf780d1173a0c895 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 7 Nov 2019 12:05:44 -0500 Subject: [PATCH] Add org-scratch command --- emacs/init.org | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index cb184aa..dba54b7 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -1031,14 +1031,32 @@ Enable async source block execution. Note: this execute the contents of the sour #+BEGIN_SRC emacs-lisp (setq org-image-actual-width '(1000)) #+END_SRC +** org-scratch +It's very useful to open a new org buffer for a quick org-babel exploration. +#+BEGIN_SRC emacs-lisp + (defun org-scratch (&optional make-new) + "Switches to an org-mode buffer not associated with any file. + If called with a prefix argument, always creates a new buffer; + otherwise, switches to the existing *org-scratch* buffer if it exists." + (interactive "P") + (let ((org-scratch-buffer-name + (generate-new-buffer-name + "*org-scratch*" + (unless make-new "*org-scratch*")))) + (switch-to-buffer org-scratch-buffer-name) + (org-mode))) + + (leader-def-key "os" #'org-scratch) +#+END_SRC * Projectile #+BEGIN_SRC emacs-lisp (use-package projectile :config (projectile-mode) (jdormit/define-prefix "p" "projectile") - (leader-def-key "pf" 'projectile-find-file) - (leader-def-key "pg" 'projectile-grep)) + (leader-def-key "pf" #'projectile-find-file) + (leader-def-key "pg" #'projectile-grep) + (leader-def-key "pp" #'projectile-switch-project)) #+END_SRC * Mode line