Eshell: Bind RET to append-region-to-command-line
parent
0864798106
commit
3a88ea3e59
|
@ -304,4 +304,15 @@ See `eshell' for the numeric prefix ARG."
|
||||||
(setq fish-completion-fallback-on-bash-p t)
|
(setq fish-completion-fallback-on-bash-p t)
|
||||||
(global-fish-completion-mode)))
|
(global-fish-completion-mode)))
|
||||||
|
|
||||||
|
;; Misc.
|
||||||
|
(defun ambrevar/eshell-append-region-to-command-line (begin end)
|
||||||
|
(interactive "r")
|
||||||
|
(save-mark-and-excursion
|
||||||
|
(let ((string (buffer-substring-no-properties begin end)))
|
||||||
|
(setq string (string-trim string))
|
||||||
|
(setq string (concat string " "))
|
||||||
|
(goto-char (point-max))
|
||||||
|
(ignore-errors (cycle-spacing 0))
|
||||||
|
(insert string))))
|
||||||
|
|
||||||
(provide 'init-eshell)
|
(provide 'init-eshell)
|
||||||
|
|
|
@ -231,4 +231,8 @@
|
||||||
(dolist (map (list elfeed-search-mode-map elfeed-show-mode-map))
|
(dolist (map (list elfeed-search-mode-map elfeed-show-mode-map))
|
||||||
(evil-define-key 'normal map "m" 'ambrevar/elfeed-add-bookmark)))
|
(evil-define-key 'normal map "m" 'ambrevar/elfeed-add-bookmark)))
|
||||||
|
|
||||||
|
;; Eshell
|
||||||
|
(with-eval-after-load 'init-eshell
|
||||||
|
(evil-define-key 'visual eshell-mode-map (kbd "<return>") 'ambrevar/eshell-append-region-to-command-line))
|
||||||
|
|
||||||
(provide 'init-evil)
|
(provide 'init-evil)
|
||||||
|
|
Loading…
Reference in New Issue