Skip to content

Instantly share code, notes, and snippets.

@prathik
Last active June 14, 2019 09:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save prathik/b647da736530913bf29c43d593ca537e to your computer and use it in GitHub Desktop.
Save prathik/b647da736530913bf29c43d593ca537e to your computer and use it in GitHub Desktop.
Emacs - Switch to new notes 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")))
(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
)
@Ironjanowar
Copy link

Awesome! Straight into my Emacs configuration!

Maybe activate org-mode ?? Here is my fork :D

@dieggsy
Copy link

dieggsy commented Jan 19, 2018

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