Add org-scratch command

This commit is contained in:
Jeremy Dormitzer 2019-11-07 12:05:44 -05:00
parent 91e7bcacc1
commit 47f45957aa

View File

@ -1031,14 +1031,32 @@ Enable async source block execution. Note: this execute the contents of the sour
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq org-image-actual-width '(1000)) (setq org-image-actual-width '(1000))
#+END_SRC #+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 * Projectile
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package projectile (use-package projectile
:config :config
(projectile-mode) (projectile-mode)
(jdormit/define-prefix "p" "projectile") (jdormit/define-prefix "p" "projectile")
(leader-def-key "pf" 'projectile-find-file) (leader-def-key "pf" #'projectile-find-file)
(leader-def-key "pg" 'projectile-grep)) (leader-def-key "pg" #'projectile-grep)
(leader-def-key "pp" #'projectile-switch-project))
#+END_SRC #+END_SRC
* Mode line * Mode line