2019-05-18 23:41:18 -04:00
|
|
|
;;; term/eshell/autoload/commands.el -*- lexical-binding: t; -*-
|
2018-06-18 22:31:27 +02:00
|
|
|
|
2019-10-18 19:40:27 -04:00
|
|
|
;;;###autoload
|
|
|
|
(defun eshell/emacs (&rest files)
|
|
|
|
"Open a FILES in Emacs.
|
|
|
|
For folks with a habit of using \"emacs\" to open files, even in eshell."
|
2019-11-23 00:52:36 -05:00
|
|
|
(if files
|
2019-10-18 19:40:27 -04:00
|
|
|
(mapc #'find-file
|
|
|
|
(mapcar #'expand-file-name
|
2019-11-23 00:52:36 -05:00
|
|
|
(eshell-flatten-list (reverse files))))
|
2019-10-18 19:40:27 -04:00
|
|
|
(bury-buffer)))
|
|
|
|
;;;###autoload
|
|
|
|
(defalias 'eshell/e #'eshell/emacs)
|
|
|
|
|
2018-06-18 22:31:27 +02:00
|
|
|
;;;###autoload
|
|
|
|
(defun eshell/cd-to-project ()
|
|
|
|
"Change to the project root of the current directory."
|
2018-09-28 13:54:20 -04:00
|
|
|
(eshell/cd (doom-project-root (eshell/pwd))))
|
2018-06-18 22:31:27 +02:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun eshell/quit-and-close (&rest _)
|
|
|
|
"Quit the current eshell buffer and close the window it's in."
|
|
|
|
(setq-local +eshell-kill-window-on-exit t)
|
|
|
|
(throw 'eshell-terminal t))
|
2018-07-06 15:33:25 +02:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun eshell/mkdir-and-cd (dir)
|
|
|
|
"Create a directory then cd into it."
|
|
|
|
(make-directory dir t)
|
|
|
|
(eshell/cd dir))
|