-
Notifications
You must be signed in to change notification settings - Fork 6
/
+eshell.el
63 lines (56 loc) · 1.64 KB
/
+eshell.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
;;; +eshell.el -*- lexical-binding: t; -*-
;;
;;; Eshell core
(after! eshell
(setq eshell-hist-ignoredups t
eshell-buffer-maximum-lines 1024
eshell-history-size 10000)
;; Enable TRAMP to use sudo.
(require 'em-tramp)
;; Aliases
(set-eshell-alias!
"d" "dired $1"
"gl" "(call-interactively 'magit-log-current)"
"gs" "magit-status"
"gc" "magit-commit"
"gb" "(call-interactively #'magit-branch-checkout)"
"gbc" "(call-interactively #'magit-branch-create)"
"bat" "+eshell/bat $1"
"sudo" "eshell/sudo $*"
"nm" "nc/enwc"
"locate" "counsel-locate $1"
"man" "(+default/man-or-woman)"
"info" "+eshell/info-manual"
"tm" "transmission"
"cal" "calendar"
"pass" "(pass)"
"fd" "+eshell/fd $1"
"fo" "find-file-other-window $1"
"rgi" "+default/search-cwd"
"mountdrives" "nc/mount-drives")
(setenv "PAGERQ" "cat")
(add-hook! 'eshell-first-time-mode-hook
(lambda () (add-hook 'eshell-pre-command-hook 'eshell-save-some-history))))
;;
;; Detach
(use-package! detach
:load-path "~/opensource/detach"
:ensure nil
:after eshell
:config
(setq detach-db-dir doom-etc-dir)
(require 'counsel-detach)
(set-popup-rule! "\\*detach-*" :size 0.5 :side 'right :quit t :modeline nil)
;; Enable compilation minor mode
(add-hook 'detach-log-mode-hook #'compilation-minor-mode)
;; HACK reload ivy-rich to make detach config take effect.
(ivy-rich-mode 0)
(ivy-rich-mode +1))
(use-package! detach-eshell
:load-path "~/opensource/detach"
:ensure nil
:after eshell
:config
(map! :map eshell-mode-map
:ni [C-return] #'counsel-detach
:ni [S-return] #'detach-create-session))