Skip to content

Commit

Permalink
write a proper eshell-evil-append
Browse files Browse the repository at this point in the history
  • Loading branch information
nathantypanski committed Nov 11, 2014
1 parent 2f14b03 commit 83f0b33
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions config/my-eshell.el
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@
(evil-insert-state))

(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
the next VCOUNT - 1 lines starting at the same column . If
SKIP-EMPTY-LINES is non-nil, the insertion will not be performed
on lines on which the insertion point would be after the end of
the lines . "
"If the comint prompt is before point, just do evil-append. Otherwise, insert after the prompt"
"Perform an evil-append if point is after the last prompt. Otherwise, jump to the prompt in insert state."
(interactive
(list (prefix-numeric-value current-prefix-arg)
(and (evil-visual-state-p)
Expand All @@ -52,11 +46,13 @@
;; `count-lines' yields accurate results
(evil-visual-rotate 'upper-left)
(count-lines evil-visual-beginning evil-visual-end)))))
(if (my-is-eshell-before-prompt)
(if (or (my-is-eshell-before-prompt) (my-is-eshell-above-last-prompt))
(progn
(eshell-bol)
(my-eshell-hop-to-bottom)
(evil-insert-state))
(evil-append count vcount skip-empty-lines)))
(evil-append count vcount skip-empty-lines)
)
)

;;(require 'esh-alias)
;;(eshell/alias "ll" "ls -l")
Expand Down

0 comments on commit 83f0b33

Please sign in to comment.