diff options
author | Kyle Meyer <kyle@kyleam.com> | 2014-09-19 00:45:40 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2014-09-19 00:45:40 -0400 |
commit | f44dcf56ccdd833e5ec4081c8a7fb3451d9cf2a3 (patch) | |
tree | 152472a2ba4eab05eab58e4d171fccfd017fd226 | |
parent | 8f5f32be194aa31fe11f5433ba1aef81a8e1e450 (diff) | |
download | emacs.d-f44dcf56ccdd833e5ec4081c8a7fb3451d9cf2a3.tar.gz |
Add scratch buffer functions to ctl-x-4-map
-rw-r--r-- | lisp/init-buffile.el | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lisp/init-buffile.el b/lisp/init-buffile.el index 8c4259f..7a16983 100644 --- a/lisp/init-buffile.el +++ b/lisp/init-buffile.el @@ -93,11 +93,19 @@ user." (define-prefix-command 'km/scratch-map) (global-set-key (kbd "C-c s") 'km/scratch-map) +(define-prefix-command 'km/scratch-other-window-map) +(define-key ctl-x-4-map "s" 'km/scratch-other-window-map) + (defmacro km/make-find-scratch-func (name extension) `(defun ,(intern (concat "km/find-scratch-" name)) () (interactive) (find-file ,(concat "/tmp/scratch" extension)))) +(defmacro km/make-find-scratch-other-window-func (name extension) + `(defun ,(intern (concat "km/find-scratch-" name "-other-window")) () + (interactive) + (find-file-other-window ,(concat "/tmp/scratch" extension)))) + (km/make-find-scratch-func "elisp" ".el") (km/make-find-scratch-func "python" ".py") (km/make-find-scratch-func "shell" ".sh") @@ -107,6 +115,15 @@ user." (km/make-find-scratch-func "markdown" ".md") (km/make-find-scratch-func "nomode" "") +(km/make-find-scratch-other-window-func "elisp" ".el") +(km/make-find-scratch-other-window-func "python" ".py") +(km/make-find-scratch-other-window-func "shell" ".sh") +(km/make-find-scratch-other-window-func "r" ".r") +(km/make-find-scratch-other-window-func "haskell" ".hs") +(km/make-find-scratch-other-window-func "org" ".org") +(km/make-find-scratch-other-window-func "markdown" ".md") +(km/make-find-scratch-other-window-func "nomode" "") + (define-key km/scratch-map "e" 'km/find-scratch-elisp) (define-key km/scratch-map "p" 'km/find-scratch-python) (define-key km/scratch-map "s" 'km/find-scratch-shell) @@ -116,4 +133,21 @@ user." (define-key km/scratch-map "m" 'km/find-scratch-markdown) (define-key km/scratch-map "n" 'km/find-scratch-nomode) +(define-key km/scratch-other-window-map "e" + 'km/find-scratch-elisp-other-window) +(define-key km/scratch-other-window-map "p" + 'km/find-scratch-python-other-window) +(define-key km/scratch-other-window-map "s" + 'km/find-scratch-shell-other-window) +(define-key km/scratch-other-window-map "r" + 'km/find-scratch-r-other-window) +(define-key km/scratch-other-window-map "h" + 'km/find-scratch-haskell-other-window) +(define-key km/scratch-other-window-map "o" + 'km/find-scratch-org-other-window) +(define-key km/scratch-other-window-map "m" + 'km/find-scratch-markdown-other-window) +(define-key km/scratch-other-window-map "n" + 'km/find-scratch-nomode-other-window) + (provide 'init-buffile) |