Skip to content

Commit

Permalink
Scratch buffer keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeto committed Nov 7, 2012
1 parent dd96c31 commit d02e3b0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions my-funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,15 @@ prefix argument, the process's buffer is displayed."
(message (format "%s: %s" proc event)))

(global-set-key (kbd "s-x") 'launch)

;; Quick switch to scratch buffers

(defmacro scratch-key (key buffer-name mode)
`(global-set-key ,key (lambda ()
(interactive)
(switch-to-buffer ,buffer-name)
(,mode))))

(scratch-key (kbd "C-S-s") "*scratch*" lisp-interaction-mode)
(scratch-key (kbd "C-S-d") "*javascript*" js2-mode)
(scratch-key (kbd "C-S-a") "*lisp*" lisp-mode)

0 comments on commit d02e3b0

Please sign in to comment.