Last active
June 14, 2019 09:49
-
-
Save prathik/b647da736530913bf29c43d593ca537e to your computer and use it in GitHub Desktop.
Emacs - Switch to new notes buffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun new-scratch-buffer-new-window () | |
"Create a new scratch buffer in a | |
new window. I generally take a lot of notes | |
in different topics. For each new topic hit | |
C-c C-s and start taking your notes. | |
Most of these notes don't need to be | |
saved but are used like quick post it | |
notes." | |
(interactive) | |
(let (($buf (generate-new-buffer "notes"))) | |
(split-window-right) | |
(other-window 1) | |
(balance-windows) | |
(switch-to-buffer $buf) | |
$buf | |
(org-mode) | |
)) | |
(global-set-key | |
(kbd "C-c C-s") | |
'new-scratch-buffer-new-window | |
) |
You could just use pop-to-buffer
:
(defun new-scratch-buffer-new-window ()
"Create a new scratch buffer in a
new window. I generally take a lot of notes
in different topics. For each new topic hit
C-c C-s and start taking your notes.
Most of these notes don't need to be
saved but are used like quick post it
notes."
(interactive)
(let ((buf (generate-new-buffer "notes")))
(pop-to-buffer buf)
(balance-windows)
buf))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome! Straight into my Emacs configuration!
Maybe activate
org-mode
?? Here is my fork :D