From 9c8cf2914093f1d18f8c81aab626f128983c56d9 Mon Sep 17 00:00:00 2001 From: Nathan Typanski Date: Fri, 29 Aug 2014 09:48:47 -0400 Subject: [PATCH] hop to bottom on eshell insert --- config/my-eshell.el | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/config/my-eshell.el b/config/my-eshell.el index 3bad581..c386690 100644 --- a/config/my-eshell.el +++ b/config/my-eshell.el @@ -1,4 +1,11 @@ (after 'evil + + (defun my-eshell-hop-to-bottom () + "Go to the end of the buffer and eshell prompt." + (interactive) + (evil-goto-line) + (eshell-bol)) + (defun my-is-eshell-before-prompt () "Call THEN if point is before the end of the eshell prompt. Otherwise call ELSE if present." (let ((oldpt (point)) @@ -17,15 +24,12 @@ "If the eshell prompt is before point, enter insert state. Otherwise, insert after the prompt" (interactive) (if (my-is-eshell-before-prompt) - (eshell-bol)) + (progn + (eshell-bol) + (my-eshell-hop-to-bottom) + )) (evil-insert-state)) - (defun my-eshell-hop-to-bottom () - "Go to the end of the buffer and eshell prompt." - (interactive) - (evil-goto-line) - (eshell-bol)) - (defun my-eshell-evil-append (count &optional vcount skip-empty-lines) "Switch to Insert state just after point . The insertion will be repeated COUNT times and repeated once for