Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Scratch buffer keys.

  • Loading branch information...
commit d02e3b0afbb8dc24fd2eff57c592c17d9be5199a 1 parent dd96c31
@skeeto authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 my-funcs.el
View
12 my-funcs.el
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.