update
[emacs-init.git] / setup / eshell.el
1 (require 'esh-mode)
2
3 ; grrr ... eshell-mode-map is buffer-local ...
4 (defun my-setup-eshell ()
5   (define-key eshell-mode-map (kbd "<up>") 'previous-line)
6   (define-key eshell-mode-map (kbd "<down>") 'next-line)
7   (define-key eshell-mode-map (kbd "C-<up>") 'eshell-previous-matching-input-from-input)
8   (define-key eshell-mode-map (kbd "C-<down>") 'eshell-next-matching-input-from-input)
9   (define-key eshell-mode-map (kbd "<home>") 'eshell-bol))
10
11 (add-hook 'eshell-mode-hook 'my-setup-eshell)
12
13 (defun eshell-switch-directory-current-buffer ()
14   (interactive)
15   (let ((dir default-directory)
16         (eshell-buffer (get-buffer "*eshell*")))
17     (if (not eshell-buffer)
18         (error "no *eshell* buffer found"))
19     (my-pop-to-buffer (get-buffer "*eshell*"))
20     (goto-char (point-max))
21     (setq default-directory dir)
22     (eshell-interrupt-process)))
23
24 (global-set-key "\C-cE" 'eshell-switch-directory-current-buffer)
25
26 (setenv "PATH" (concat (getenv "PATH")
27                        ":"
28                        (expand-file-name "~/bin")
29                        ":"
30                        (expand-file-name "~/.local/bin")))