;;; -*- lexical-binding: t; -*- (use-package eshell :bind (:map eshell-mode-map ("M-r" . consult-history)) :hook ((eshell-first-time-mode . kj/eshell-on-load)) :config (add-hook 'eshell-mode-hook (lambda () (setenv "PAGER" "cat")) (setenv "EDITOR" "emacsclient")) (setq eshell-prefer-lisp-functions nil eshell-scroll-to-bottom-on-input 'all eshell-hist-ignoredups t eshell-destroy-buffer-when-process-dies t eshell-review-quick-commands nil eshell-smart-space-goes-to-end t eshell-error-if-no-glob t) (setq tramp-remote-path '(tramp-own-remote-path)) (defun kj/eshell-on-load () (dolist (command '("htop" "tmux" "vim" "nvim")) (add-to-list 'eshell-visual-commands command))) (add-to-list 'eshell-complex-commands "ssh") (add-to-list 'eshell-modules-list 'eshell-smart) (add-to-list 'eshell-modules-list 'eshell-tramp) (add-hook 'eshell-mode-hook 'visual-line-mode)) (use-package pcmpl-args) (use-package esh-help :init (setup-esh-help-eldoc)) (use-package eshell-syntax-highlighting :hook (eshell-mode . eshell-syntax-highlighting-mode)) (defun eshell/ssh (&rest args) (if (= 1 (length args)) (throw 'eshell-replace-command (eshell/cd (format "/ssh:%s:" (car args)))) (throw 'eshell-replace-command (eshell-parse-command "*ssh" (eshell-stringify-list (flatten-tree args)))))) (provide 'kj-eshell)