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