summaryrefslogtreecommitdiff
path: root/emacs/.config/emacs-kj/lisp/kj-eshell.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/.config/emacs-kj/lisp/kj-eshell.el')
-rw-r--r--emacs/.config/emacs-kj/lisp/kj-eshell.el83
1 files changed, 0 insertions, 83 deletions
diff --git a/emacs/.config/emacs-kj/lisp/kj-eshell.el b/emacs/.config/emacs-kj/lisp/kj-eshell.el
deleted file mode 100644
index 7004b1d..0000000
--- a/emacs/.config/emacs-kj/lisp/kj-eshell.el
+++ /dev/null
@@ -1,83 +0,0 @@
-;;; -*- 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-error-if-no-glob t)
- (setq tramp-remote-path '(tramp-own-remote-path))
-
- (defun kj/eshell-on-load ()
- (dolist (command '("htop" "tmux" "vim" "nvim" "watch"))
- (add-to-list 'eshell-visual-commands
- command))
-
- ;; (define-key eshell-prompt-mode-map (kbd "C-d") 'eshell-life-is-too-much)
- )
-
- (add-to-list 'eshell-complex-commands "ssh")
-
- (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))))))
-
-(defvar kj/eshell-here-directory)
-
-(defun kj/eshell-buffer-name ()
- (let ((base (concat "*eshell:" default-directory)))
- (cond
- ((not (get-buffer base)) base)
- (t (cl-loop for n from 2
- for name = (format "%s<%d>" base n)
- until (not (get-buffer name))
- finally return name)))))
-
-(defun kj/eshell-update-buffer-name ()
- (interactive)
- (rename-buffer (kj/eshell-buffer-name)))
-(add-hook 'eshell-directory-change-hook 'kj/eshell-update-buffer-name)
-
-(defun kj/new-eshell-here ()
- (let ((default-directory kj/eshell-here-directory))
- (eshell t)))
-
-(defun kj/eshell-here ()
- (interactive)
- (unless (eq last-command 'kj/eshell-here)
- (setq kj/eshell-here-directory
- (if (derived-mode-p 'eshell-mode)
- (with-current-buffer (other-buffer (current-buffer) t)
- default-directory)
- default-directory)))
- (if (derived-mode-p 'eshell-mode)
- (kj/new-eshell-here)
- (eshell))
- (kj/eshell-update-buffer-name))
-
-(provide 'kj-eshell)