-
-
Save benjamin-asdf/d2d76e41578f3689133d73e073384ae4 to your computer and use it in GitHub Desktop.
Emacs minor mode for removing prefix dollars for shell commands
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
;; -*- lexical-binding: t; -*- | |
(define-minor-mode remove-dollars-when-yanking-lines-mode | |
"Minor mode that removes prefix dollars from lines when pasting. | |
Meant to be used in shell buffer contexts." | |
:group 'benjamin | |
(add-hook | |
'yank-transform-functions | |
(defun remove-dollars-line-start (string) | |
(s-chop-prefixes '(" " "$" " " "$") string)) | |
nil | |
'local)) | |
(add-hook 'shell-command-mode-hook 'remove-dollars-when-yanking-lines-mode) | |
;; or tell me how this is not an issue for you? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment