-
Notifications
You must be signed in to change notification settings - Fork 1
/
pheliox-eshell.el
65 lines (59 loc) · 2.62 KB
/
pheliox-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
64
65
;; common settings
(setq
eshell-save-history-on-exit t
eshell-history-size 5000
eshell-hist-ignoredups t
eshell-cmpl-ignore-case t
eshell-cp-interactive-query t
eshell-ln-interactive-query t
eshell-mv-interactive-query t
eshell-rm-interactive-query t
eshell-mv-overwrite-files nil
;; aliases-file 里面不能有多余的空行,否则会报正则表达式错误
eshell-aliases-file (expand-file-name "eshell/eshell-alias/" current-emacs-path)
eshell-highlight-prompt t
;; 提示符设置,下面两项必须对应起来,
;; 否则会报 read-only,并且不能补全什么的
;; eshell-prompt-regexp "^[^#$\n]* [#>]+ "
;; eshell-prompt-function (lambda nil
;; (concat (abbreviate-file-name (eshell/pwd))
;; (if
;; (= (user-uid) 0)
;; " # " " >>> ")))
)
(setq eshell-cmpl-cycle-completions nil
eshell-save-history-on-exit t
eshell-cmpl-dir-ignore "\\`\\(\\.\\.?\\|CVS\\|\\.svn\\|\\.git\\)/\\'")
;; (eval-after-load 'esh-opt
;; '(progn
;; (require 'em-cmpl)
;; (require 'em-prompt)
;; (require 'em-term)
;; ;; TODO: for some reason requiring this here breaks it, but
;; ;; requiring it after an eshell session is started works fine.
;; ;; (require 'eshell-vc)
;; (setenv "PAGER" "cat")
;; ;; (set-face-attribute 'eshell-prompt nil :foreground "turquoise1")
;; ;; (add-hook 'eshell-mode-hook ;; for some reason this needs to be a hook
;; ;; '(lambda () (define-key eshell-mode-map "\C-a" 'eshell-bol)))
;; (add-to-list 'eshell-visual-commands "ssh")
;; (add-to-list 'eshell-visual-commands "tail")
;; (add-to-list 'eshell-command-completions-alist
;; '("gunzip" "gz\\'"))
;; (add-to-list 'eshell-command-completions-alist
;; '("tar" "\\(\\.tar|\\.tgz\\|\\.tar\\.gz\\)\\'"))
;; (add-to-list 'eshell-output-filter-functions 'eshell-handle-ansi-color)))
;;command timing statistics
;; (add-hook 'eshell-load-hook
;; (lambda()(setq last-command-start-time (time-to-seconds))))
;; (add-hook 'eshell-pre-command-hook
;; (lambda()(setq last-command-start-time (time-to-seconds))))
;; (add-hook 'eshell-before-prompt-hook
;; (lambda()
;; (message "spend %g seconds"
;; (- (time-to-seconds) last-command-start-time))))
;;tramp password settings
(setq password-cache-expiry nil)
;;eshell color settings
(add-hook 'eshell-mode-hook 'ansi-color-for-comint-mode-on)
(provide 'pheliox-eshell)