Remove useless eshell stuff

This commit is contained in:
MitchMarq42 2022-08-08 06:32:57 -08:00
parent 6c08a06775
commit cc020903eb

View File

@ -13,49 +13,7 @@ This is taken from a website that I can't remember at the moment."
(mapc (mapc
#'find-file-other-window #'find-file-other-window
(mapcar (mapcar
#'expand-file-name (eshell-flatten-list (reverse args)))))) #'expand-file-name (flatten-tree (reverse args))))))
(defun eshell/clear ()
"Clear the scrollback buffer, like `clear' in a real shell..."
(eshell/clear-scrollback))
(defun eshell/faketty (&rest args)
"USAGE: `faketty ARGS` where ARGS is anything that spews colors.
Credit: https://stackoverflow.com/questions/1401002/how-to-trick-an-application-into-thinking-its-stdout-is-a-terminal-not-a-pipe"
(shell-command-to-string
(format "script -qfc %s /dev/null" args)))
(defun with-face (str &rest face-plist)
(propertize str 'face face-plist))
(defun custom-eshell-prompt ()
(let* (
;; Get the git branch.
(git-branch-unparsed
(shell-command-to-string "git rev-parse --abbrev-ref HEAD 2>/dev/null"))
(git-branch
(if (string= git-branch-unparsed "")
""
;; Remove the trailing newline.
(substring git-branch-unparsed 0 -1)))
)
(concat
;; Timestamp.
;; (with-face
;; (format-time-string "[%a, %b %d | %H:%M:%S]\n" (current-time))
;; :inherit font-lock-builtin-face)
;; Directory.
(with-face (concat (airline-shorten-directory default-directory (/ (window-width) 2)) " ") :inherit font-lock-constant-face)
;; Git branch.
(unless (string= git-branch "")
(with-face (concat "[" git-branch "]") :inherit font-lock-string-face))
"\n"
;; Prompt.
;; NOTE: Need to keep " $" for the next/previous prompt regexp to work.
(with-face ">" :inherit font-lock-preprocessor-face)
" "
)))
(setq eshell-prompt-function 'custom-eshell-prompt)
(setq eshell-highlight-prompt nil)
(provide 'eshell-settings) (provide 'eshell-settings)
;;; eshell-settings.el ends here ;;; eshell-settings.el ends here