Guest User

shell

a guest
Oct 1st, 2023
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 1.40 KB | None | 0 0
  1. ;;; Package --- Summary
  2. ;;; Commentary:
  3. ;;; Settings for shell
  4.  
  5. ;;; Code:
  6. (use-package eshell-z
  7.   :ensure t)
  8. (use-package multi-term
  9.   :ensure t
  10.   :bind(:map global-map
  11.              ("<f9>" . 'multi-term)
  12.              ("C-<f9>" . 'multi-term-prev)
  13.              ("M-<f9>" . 'multi-term-next))
  14.   :config (setq-default multi-term-program "/bin/bash")
  15.   (setq-default eshell-last-dir-ring-size 500))
  16. (defun eshell-scroll-to-bottom (window display-start)
  17.   (if (and window (window-live-p window))
  18.       (let ((resize-mini-windows nil))
  19.     (save-selected-window
  20.       (select-window window)
  21.       (save-restriction
  22.         (widen)
  23.         (when (> (point) eshell-last-output-start) ; we're editing a line. Scroll.
  24.           (save-excursion
  25.         (recenter -1)
  26.         (sit-for 0))))))))
  27.  
  28. (defun eshell-add-scroll-to-bottom ()
  29.   (interactive)
  30.   (make-local-hook 'window-scroll-functions)
  31.   (add-hook 'window-scroll-functions 'eshell-scroll-to-bottom nil t))
  32.  
  33. (add-hook 'eshell-mode-hook 'eshell-add-scroll-to-bottom)
  34. (when (and (executable-find "fish")
  35.            (require 'fish-completion nil t))
  36.   (global-fish-completion-mode))
  37. (add-hook 'eshell-mode-hook (lambda()
  38.                   (interactive)
  39.                   (eshell-did-you-mean-setup)))
  40.  
  41. (eval-after-load 'eshell
  42.     '(require 'eshell-z nil t))
  43. (add-hook 'eshell-mode-hook 'eshell-fringe-status-mode)
  44.  
  45.  
  46. ;;; shell.el ends here
  47.  
Advertisement
Add Comment
Please, Sign In to add comment