diff options
author | Case Duckworth | 2021-11-21 23:57:41 -0600 |
---|---|---|
committer | Case Duckworth | 2021-11-21 23:57:41 -0600 |
commit | a2657993bad828af6743c68931a0e848bfcdec53 (patch) | |
tree | 1e9220389184a0c68bc9f6bfe08edca3f2a362e6 /eshell.el | |
parent | Un-stupidify org-mode filling (diff) | |
download | emacs-a2657993bad828af6743c68931a0e848bfcdec53.tar.gz emacs-a2657993bad828af6743c68931a0e848bfcdec53.zip |
I DECLARE BANKRUPTCY ... 8
Didn't think to do this till pretty .. written, so here we are.
Diffstat (limited to 'eshell.el')
-rw-r--r-- | eshell.el | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/eshell.el b/eshell.el deleted file mode 100644 index c6d8e16..0000000 --- a/eshell.el +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | ;;; eshell.el --- eshell-specific configuration -*- lexical-binding: t; -*- | ||
2 | |||
3 | ;; Copyright (C) 2021 Case Duckworth | ||
4 | |||
5 | ;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> | ||
6 | |||
7 | ;;; Commentary: | ||
8 | |||
9 | ;; Much like ~/.emacs.d/gnus.el, this is eshell-specific configuration that's | ||
10 | ;; loaded whenever `eshell' is loaded. | ||
11 | |||
12 | ;;; Code: | ||
13 | |||
14 | (require 'setup) | ||
15 | (require 'eshell) | ||
16 | (require 'em-alias) | ||
17 | |||
18 | ;;; Environment | ||
19 | (setenv "PAGER" "cat") | ||
20 | |||
21 | ;;; Aliases | ||
22 | |||
23 | (dolist (definition '(("e" . "find-file $1") | ||
24 | ("ff" . "find-file $1") | ||
25 | ("emacs" . "find-file $1") | ||
26 | ("ee" . "find-file-other-window $1"))) | ||
27 | (cl-letf (((symbol-function 'eshell-write-aliases-list) #'ignore)) | ||
28 | (eshell/alias (car definition) (cdr definition)))) | ||
29 | (eshell-write-aliases-list) | ||
30 | |||
31 | ;;; Functions | ||
32 | |||
33 | ;; https://karthinks.com/software/jumping-directories-in-eshell/ | ||
34 | (defun eshell/z (&optional regexp) | ||
35 | "Navigate to a previously visited directory in eshell, or to | ||
36 | any directory proferred by `consult-dir'." | ||
37 | (let ((eshell-dirs (delete-dups | ||
38 | (mapcar 'abbreviate-file-name | ||
39 | (ring-elements eshell-last-dir-ring))))) | ||
40 | (cond | ||
41 | ((and (not regexp) (featurep 'consult-dir)) | ||
42 | (let* ((consult-dir--source-eshell `(:name "Eshell" | ||
43 | :narrow ?e | ||
44 | :category file | ||
45 | :face consult-file | ||
46 | :items ,eshell-dirs)) | ||
47 | (consult-dir-sources (cons consult-dir--source-eshell | ||
48 | consult-dir-sources))) | ||
49 | (eshell/cd (substring-no-properties | ||
50 | (consult-dir--pick "Switch directory: "))))) | ||
51 | (t (eshell/cd (if regexp (eshell-find-previous-directory regexp) | ||
52 | (completing-read "cd: " eshell-dirs))))))) | ||
53 | |||
54 | ;;; Extra eshell packages | ||
55 | |||
56 | (setup (:straight esh-autosuggest) | ||
57 | (:hook-into eshell-mode)) | ||
58 | |||
59 | (setup (:straight eshell-syntax-highlighting) | ||
60 | (eshell-syntax-highlighting-global-mode +1)) | ||
61 | |||
62 | (setup (:straight-when fish-completion | ||
63 | (executable-find "fish")) | ||
64 | (:autoload global-fish-completion-mode) | ||
65 | (global-fish-completion-mode +1)) | ||
66 | |||
67 | (setup (:straight-when eshell-vterm | ||
68 | (require 'vterm nil :noerror)) | ||
69 | (eshell-vterm-mode +1) | ||
70 | (defalias 'eshell/v 'eshell-exec-visual)) | ||
71 | |||
72 | ;;; Miscellaneous | ||
73 | |||
74 | ;; Fix modeline | ||
75 | (when (boundp 'simple-modeline--mode-line) | ||
76 | (setq mode-line-format '(:eval simple-modeline--mode-line))) | ||
77 | |||
78 | (provide 'eshellrc) | ||
79 | ;;; eshell.el ends here | ||
80 | |||
81 | ;; Local Variables: | ||
82 | ;; flymake-inhibit: t | ||
83 | ;; End: | ||