Created
February 5, 2014 00:45
-
-
Save nhunzaker/8815412 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
;;; bash.el -- Sets some key bindings for shell-script-mode | |
;;; Commentary: | |
;;; Code: | |
(defun current-buffer-to-string () | |
"Get the contents of the current buffer as a string." | |
(interactive) | |
(buffer-substring (point-min) (point-max))) | |
(defun shell-script-mode-eval-buffer() | |
"Evaluate the current buffer in the shell." | |
(interactive) | |
(message (shell-command-to-string (current-buffer-to-string)))) | |
(defun local-keys () | |
"Set up local keys for `shell-script-mode'." | |
(local-unset-key [(hyper return)]) | |
(local-set-key [(hyper return)] 'shell-script-mode-eval-buffer)) | |
(add-hook 'sh-mode-hook 'local-keys) | |
;;; bash.el ends here |
This file contains hidden or 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
say "awwww yiss" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment