2019-05-18 23:41:18 -04:00
|
|
|
;;; term/eshell/autoload/evil.el -*- lexical-binding: t; -*-
|
2019-04-21 19:59:44 -04:00
|
|
|
;;;###if (featurep! :editor evil)
|
2017-02-19 18:53:38 -05:00
|
|
|
|
2019-05-18 23:41:18 -04:00
|
|
|
;;;###autoload (autoload '+eshell:run "term/eshell/autoload/evil" nil t)
|
2018-06-18 22:31:27 +02:00
|
|
|
(evil-define-command +eshell:run (command bang)
|
|
|
|
"TODO"
|
|
|
|
(interactive "<fsh><!>")
|
|
|
|
(let ((buffer (+eshell-last-buffer))
|
2020-04-26 04:12:33 -04:00
|
|
|
(command (+evil-replace-filename-modifiers-a command)))
|
2018-06-18 22:31:27 +02:00
|
|
|
(cond (buffer
|
|
|
|
(select-window (get-buffer-window buffer))
|
|
|
|
(+eshell-run-command command buffer))
|
|
|
|
(bang (+eshell/open nil command))
|
|
|
|
((+eshell/open-popup nil command)))))
|
|
|
|
|
2018-05-26 18:58:00 +02:00
|
|
|
;;;###autoload
|
2019-07-23 00:07:14 +02:00
|
|
|
(defun +eshell-goto-prompt-on-insert-a ()
|
2018-05-26 18:58:00 +02:00
|
|
|
"Move cursor to the prompt when switching to insert mode (if point isn't
|
2019-06-11 07:57:26 +02:00
|
|
|
already there).
|
|
|
|
|
|
|
|
Meant to replace `evil-collection-eshell-next-prompt-on-insert'."
|
2018-05-26 18:58:00 +02:00
|
|
|
(when (< (point) eshell-last-output-end)
|
|
|
|
(goto-char
|
|
|
|
(if (memq this-command '(evil-append evil-append-line))
|
|
|
|
(point-max)
|
|
|
|
eshell-last-output-end))))
|
|
|
|
|
2018-05-26 19:13:15 +02:00
|
|
|
;;;###autoload
|
|
|
|
(defun +eshell/goto-end-of-prompt ()
|
|
|
|
"Move cursor to the prompt when switching to insert mode (if point isn't
|
|
|
|
already there)."
|
|
|
|
(interactive)
|
|
|
|
(goto-char (point-max))
|
|
|
|
(evil-append 1))
|