summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--shells.el
blob: 22860b3d32c909461ed853ba7f33d966be0ac6a1 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
;;; -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:


(with-eval-after-load "term" (defalias 'term 'ansi-term))

(add-to-list 'exec-path "/home/bdunahu/.local/bin")

(use-package esh-module
  :config
  (add-to-list 'eshell-modules-list 'eshell-smart))

(use-package esh-mode
  :config
  (setopt eshell-scroll-to-bottom-on-input 'this))

(use-package em-banner
  :config
  (setopt eshell-banner-message (concat "\n" (propertize " " 'display (create-image (expand-file-name "images/raven.png" user-emacs-directory) 'png nil :scale 0.8 :align-to "center")) "\n")))

(use-package em-term
  :config
  (add-to-list 'eshell-visual-commands "nethack")
  (add-to-list 'eshell-visual-commands "r2"))

(use-package em-prompt
  :config
  (defun bd/get-prompt-path ()
    (abbreviate-file-name (eshell/pwd)))
  (defun bd/eshell-prompt ()
    "Return a prettified shell prompt."
    (concat
     (system-name)
     (format " %s" (bd/get-prompt-path))
     " >\n"))
  (setopt eshell-prompt-function 'bd/eshell-prompt
          eshell-prompt-regexp (rx bol (eval (system-name)) (one-or-more anything) " >\n")))

(use-package eshell
  :bind
  (:map eshell-mode-map
        ("<tab>" . #'completion-at-point)
        ("C-l" . #'eshell/clear))
  :config
  (defun eshell/clear (&optional scrollback)
    "Clear the eshell buffer and output the banner message."
    (interactive)
    (let ((inhibit-read-only t))
      (delete-all-overlays)
      (set-text-properties (point-min) (point-max) nil)
      (erase-buffer)
      (eval eshell-banner-message)))
  (defun eshell/o (file)
    (interactive)
    (find-file file))
  (setopt eshell-buffer-maximum-lines 7500))


(use-package shell
  :bind
  (:map shell-mode-map
        ("C-c C-k" . #'comint-clear-buffer))
  :config
  (setopt shell-command-prompt-show-cwd t
          shell-highlight-undef-enable t
          shell-kill-buffer-on-exit t
          comint-prompt-read-only t))


(use-package proced
  :config
  (add-hook 'proced-mode-hook
            (lambda ()
              (proced-toggle-auto-update 1))))


(provide 'bd--shells)
;;; bd--shells.el ends here