Skip to content

Instantly share code, notes, and snippets.

@ethan5422
ethan5422 / eshell-insert-last-word.el
Last active January 4, 2016 08:09
eshell-insert-last-word
(defun eshell-last-argument (n m)
(let* ((input (substring-no-properties
(eshell-previous-input-string (1- m))))
(parse (with-temp-buffer
(insert input)
(nth (1- n) (reverse (eshell-parse-arguments
(point-min) (point-max)))))))
(eval parse)))
(defun eshell-insert-last-word (n)