-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathterm.el
68 lines (63 loc) · 2.67 KB
/
term.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
66
67
68
;;; term.el -*- lexical-binding: t; -*-
(after! em-glob
;; Allow us to type HEAD~1, HEAD~2, etc., as arguments to git commands.
(setq eshell-error-if-no-glob nil))
(after! vterm
(setq vterm-max-scrollback 100000))
(after! comint
(setq comint-history-isearch 'dwim
comint-buffer-maximum-size 8192))
(setq-hook! 'comint-mode-hook
imenu-generic-expression
`(("Prompts" ,(concat comint-prompt-regexp "\\(.*\\)") 1))
;; For aider.el since the AI model outputs unicode whitespace characters.
nobreak-char-display nil)
(use-package! comint-histories
:after comint :config
(comint-histories-mode 1)
(setq comint-histories-global-filters '((lambda (x) (<= (length x) 3))))
(comint-histories-add-history
gdb
:predicates '((lambda () (string-match-p "^(gdb)"
(comint-histories-get-prompt))))
:length 2000)
(comint-histories-add-history
python
:predicates
'((lambda () (or (derived-mode-p 'inferior-python-mode)
(string-match-p "^>>>" (comint-histories-get-prompt)))))
:length 2000)
(comint-histories-add-history
ielm
:predicates '((lambda () (derived-mode-p 'inferior-emacs-lisp-mode)))
:length 2000)
(comint-histories-add-history
shell
:predicates '((lambda () (derived-mode-p 'shell-mode)))
:filters '("^ls" "^cd")
:length 2000)
(define-key comint-mode-map (kbd "M-r")
(lambda () (interactive)
(let ((ivy-sort-functions-alist nil)
(ivy-prescient-enable-sorting nil)
(vertico-sort-function nil)
(vertico-sort-override-function nil)
(vertico-prescient-enable-sorting nil)
(selectrum-should-sort nil)
(selectrum-prescient-enable-sorting nil))
(call-interactively #'comint-histories-search-history)))))
(after! em-term
;; Some of the commands I copied from other configurations and will likely
;; never use.
(setq eshell-visual-commands
'("ranger" "vi" "screen" "top" "less" "more" "lynx"
"ncftp" "pine" "tin" "trn" "elm" "vim" "nmtui" "alsamixer" "htop"
"elinks" "tail" "nano" "ssh" "python" "tmux" "telnet" "fzf"
"pulsemixer" "ranger" "bluetoothctl" "watch" "ncmpcpp" "btm"
"ptpython" "ipython" "pshell" "nmtui" "dstat" "pgcli" "vue" "ngrok")
eshell-visual-subcommands `(("gh" "repo" "fork")
("geth" "attach")
,@(unless (string= (getenv "GIT_PAGER")
"cat")
'(("git" "log" "diff" "show"))))
eshell-visual-options '(("git" "--help" "--paginate"))))