summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-09-06 12:51:48 -0500
committerCase Duckworth2021-09-06 12:51:48 -0500
commit3e7bb0cc182b2d062d8234f4845c33372480b3db (patch)
tree694db1eb5052e7d2ae7f270dd9d6a8c7285a44fa
parentReorganize emacs-lisp setup (diff)
downloademacs-3e7bb0cc182b2d062d8234f4845c33372480b3db.tar.gz
emacs-3e7bb0cc182b2d062d8234f4845c33372480b3db.zip
Reorganize eshell config
-rw-r--r--eshell.el70
-rw-r--r--init.el35
2 files changed, 92 insertions, 13 deletions
diff --git a/eshell.el b/eshell.el new file mode 100644 index 0000000..dc96b8e --- /dev/null +++ b/eshell.el
@@ -0,0 +1,70 @@
1;;; eshell.el --- eshell-specific configuration -*- lexical-binding: t; -*-
2
3;; Copyright (C) 2021 Case Duckworth
4
5;; Author: Case Duckworth <acdw@acdw.net>
6;; Keywords:
7
8;; This program is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation, either version 3 of the License, or
11;; (at your option) any later version.
12
13;; This program is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details.
17
18;; You should have received a copy of the GNU General Public License
19;; along with this program. If not, see <https://www.gnu.org/licenses/>.
20
21;;; Commentary:
22
23;; Much like ~/.emacs.d/gnus.el, this is eshell-specific configuration that's
24;; loaded whenever `eshell' is loaded.
25
26;;; Code:
27
28(require 'setup)
29
30;;; Environment
31(setenv "PAGER" "cat")
32
33;;; Aliases
34
35(dolist (definition '(("e" . "find-file $1")
36 ("ff" . "find-file $1")
37 ("emacs" . "find-file $1")
38 ("ee" . "find-file-other-window $1")))
39 (eshell/alias (car definition) (cdr definition)))
40
41;;; Functions
42
43;;; Extra eshell packages
44
45(setup (:straight esh-autosuggest)
46 (:hook-into eshell-mode))
47
48(setup (:straight esh-help)
49 (require 'esh-help)
50 (setq-local eldoc-documentation-function #'esh-help-eldoc-command))
51
52(setup (:straight eshell-syntax-highlighting)
53 (eshell-syntax-highlighting-global-mode +1))
54
55(setup (:straight-if fish-completion
56 (executable-find "fish"))
57 (:autoload global-fish-completion-mode)
58 (global-fish-completion-mode +1))
59
60;;; Miscellaneous
61
62;; Fix modeline
63(when (boundp 'simple-modeline--mode-line)
64 (setq mode-line-format '(:eval simple-modeline--mode-line)))
65
66;;; Tell Emacs our customizations are loaded.
67(defvar eshell-customizations-loaded t
68 "Whether eshell's customizations have been loaded yet.")
69
70;;; eshell.el ends here
diff --git a/init.el b/init.el index 4b7c36d..a394d9a 100644 --- a/init.el +++ b/init.el
@@ -671,6 +671,9 @@ AKA, DO NOT USE THIS FUNCTION!!!"
671 kill-read-only-ok t 671 kill-read-only-ok t
672 load-prefer-newer t 672 load-prefer-newer t
673 native-comp-async-report-warnings-errors nil 673 native-comp-async-report-warnings-errors nil
674 password-cache t
675 password-cache-expiry 3600 ; 5 minutes
676 read-extended-command-predicate ; emacs 28
674 set-mark-command-repeat-pop t) 677 set-mark-command-repeat-pop t)
675 678
676 (when (fboundp 'command-completion-default-include-p) 679 (when (fboundp 'command-completion-default-include-p)
@@ -832,33 +835,34 @@ AKA, DO NOT USE THIS FUNCTION!!!"
832(setup (:straight eros) 835(setup (:straight eros)
833 (:hook-into emacs-lisp-mode)) 836 (:hook-into emacs-lisp-mode))
834 837
835(setup (:straight esh-autosuggest)
836 (:autoload esh-autosuggest-mode)
837 (:hook-into eshell-mode))
838
839(setup eshell 838(setup eshell
840 (:also-load acdw-eshell 839 (:also-load acdw-eshell
841 em-smart) 840 em-smart
842 841 em-tramp)
842
843 (:option eshell-aliases-file (acdw/dir "eshell/aliases" t) 843 (:option eshell-aliases-file (acdw/dir "eshell/aliases" t)
844 eshell-destroy-buffer-when-process-dies t
844 eshell-directory-name (acdw/dir "eshell/" t) 845 eshell-directory-name (acdw/dir "eshell/" t)
846 eshell-error-if-no-glob t
847 eshell-hist-ignore-dups t
845 eshell-kill-on-exit nil 848 eshell-kill-on-exit nil
849 eshell-prefer-lisp-functions t ; I want to try using eshell
850 eshell-prefer-lisp-variables t ; as much as possible.
846 eshell-review-quick-commands nil 851 eshell-review-quick-commands nil
852 eshell-save-history-on-exit t
853 eshell-scroll-to-bottom-on-input 'all
847 eshell-smart-space-goes-to-end t 854 eshell-smart-space-goes-to-end t
848 eshell-where-to-jump 'begin) 855 eshell-where-to-jump 'begin)
849 856
850 ;; Make navigating amongst prompts easier
851 (:local-set outline-regexp eshell-prompt-regexp 857 (:local-set outline-regexp eshell-prompt-regexp
852 page-delimiter eshell-prompt-regexp) 858 page-delimiter eshell-prompt-regexp)
853 859
854 (:bind "C-d" #'eshell-quit-or-delete-char) 860 (:bind "C-d" #'eshell-quit-or-delete-char)
855
856 (:hook #'eshell-arg-hist-mode
857 861
862 (:hook #'eshell-arg-hist-mode
858 (defun eshell-mode@setup () 863 (defun eshell-mode@setup ()
859 ;; Fix modeline 864 (unless (bound-and-true-p eshell-customizations-loaded)
860 (when (boundp 'simple-modeline--mode-line) 865 (load (expand-file-name "eshell" user-emacs-directory))))))
861 (setq mode-line-format '(:eval simple-modeline--mode-line))))))
862 866
863(setup eww 867(setup eww
864 (:option eww-search-prefix "https://duckduckgo.com/html?q=" 868 (:option eww-search-prefix "https://duckduckgo.com/html?q="
@@ -1833,7 +1837,12 @@ If used with a numeric prefix argument N, N backticks will be inserted."
1833 (:global "M-%" #'vr/query-replace)) 1837 (:global "M-%" #'vr/query-replace))
1834 1838
1835(setup (:straight-if vterm 1839(setup (:straight-if vterm
1836 (acdw/system :home))) 1840 (acdw/system :home))
1841 (:straight (eshell-vterm
1842 :host github
1843 :repo "iostapyshyn/eshell-vterm"))
1844 (eshell-vterm-mode +1)
1845 (defalias 'eshell/v 'eshell-exec-visual))
1837 1846
1838(setup w32 1847(setup w32
1839 (:option w32-allow-system-shell t 1848 (:option w32-allow-system-shell t