Fix indentation

This commit is contained in:
2024-09-19 14:23:29 -07:00
parent 4c7b87af5f
commit 01c60ede5e

View File

@@ -21,38 +21,38 @@
(hl-line-mode -1))))
(use-package eshell
:config
(setq eshell-destroy-buffer-when-process-dies t
eshell-visual-commands '()
eshell-banner-message "")
:config
(setq eshell-destroy-buffer-when-process-dies t
eshell-visual-commands '()
eshell-banner-message "")
;; From https://karthinks.com/software/jumping-directories-in-eshell/
(defun eshell/j (&optional regexp)
"Navigate to a previously visited directory in eshell, or to
;; From https://karthinks.com/software/jumping-directories-in-eshell/
(defun eshell/j (&optional regexp)
"Navigate to a previously visited directory in eshell, or to
any directory proferred by `consult-dir'."
(let ((eshell-dirs (delete-dups
(mapcar 'abbreviate-file-name
(ring-elements eshell-last-dir-ring)))))
(cond
((and (not regexp) (featurep 'consult-dir))
(let* ((consult-dir--source-eshell `(:name "Eshell"
:narrow ?e
:category file
:face consult-file
:items ,eshell-dirs))
(consult-dir-sources (cons consult-dir--source-eshell
consult-dir-sources)))
(eshell/cd (substring-no-properties
(consult-dir--pick "Switch directory: ")))))
(t (eshell/cd (if regexp (eshell-find-previous-directory regexp)
(completing-read "cd: " eshell-dirs))))))))
(let ((eshell-dirs (delete-dups
(mapcar 'abbreviate-file-name
(ring-elements eshell-last-dir-ring)))))
(cond
((and (not regexp) (featurep 'consult-dir))
(let* ((consult-dir--source-eshell `(:name "Eshell"
:narrow ?e
:category file
:face consult-file
:items ,eshell-dirs))
(consult-dir-sources (cons consult-dir--source-eshell
consult-dir-sources)))
(eshell/cd (substring-no-properties
(consult-dir--pick "Switch directory: ")))))
(t (eshell/cd (if regexp (eshell-find-previous-directory regexp)
(completing-read "cd: " eshell-dirs))))))))
(use-package pcre2el
:ensure t
:config
(defmacro prx (&rest rx-sexp)
"Convert rx-compatible regular expressions to PCRE."
`(rxt-elisp-to-pcre (rx ,@rx-sexp))))
:ensure t
:config
(defmacro prx (&rest rx-sexp)
"Convert rx-compatible regular expressions to PCRE."
`(rxt-elisp-to-pcre (rx ,@rx-sexp))))
(use-package eshell-toggle
:ensure t
@@ -65,19 +65,19 @@ any directory proferred by `consult-dir'."
:ensure (:host github :repo "elken/eshell-p10k")
:config
(eshell-p10k-def-segment time
""
(format-time-string "%H:%M" (current-time))
'eshell-p10k-distro-face)
""
(format-time-string "%H:%M" (current-time))
'eshell-p10k-distro-face)
(defun num-exitcode-string ()
(if (= eshell-last-command-status 0)
(number-to-string eshell-p10k--prompt-num-index)
(format "%d (%d)" eshell-p10k--prompt-num-index eshell-last-command-status)))
(number-to-string eshell-p10k--prompt-num-index)
(format "%d (%d)" eshell-p10k--prompt-num-index eshell-last-command-status)))
(defun num-exitcode-face ()
(if (= eshell-last-command-status 0)
'eshell-p10k-git-clean-face
'eshell-p10k-git-dirty-face))
'eshell-p10k-git-clean-face
'eshell-p10k-git-dirty-face))
(eshell-p10k-def-segment num-exitcode
""
@@ -85,7 +85,7 @@ any directory proferred by `consult-dir'."
(num-exitcode-face))
(defun eshell-p10k-prompt-function ()
"Prompt defining function."
(eshell-p10k-def-prompt '(num-exitcode time dir git)))
"Prompt defining function."
(eshell-p10k-def-prompt '(num-exitcode time dir git)))
(setq eshell-prompt-function #'eshell-p10k-prompt-function
eshell-prompt-regexp eshell-p10k-prompt-string))