Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (24 sloc) 875 Bytes
;; Setup shell
;; Note: Emacs runs .bashrc in *shell*
;; So mac users should ln -s .profile .bashrc
;; bash-completion
(autoload 'bash-completion-dynamic-complete
"BASH completion hook")
(add-hook 'shell-dynamic-complete-functions
(add-hook 'shell-command-complete-functions
;; tab-completion for shell-command
(require 'shell-command)
;; C-d to kill buffer if process is dead.
(defun comint-delchar-or-eof-or-kill-buffer (arg)
(interactive "p")
(if (null (get-buffer-process (current-buffer)))
(comint-delchar-or-maybe-eof arg)))
(add-hook 'shell-mode-hook
(lambda ()
(define-key shell-mode-map (kbd "C-d") 'comint-delchar-or-eof-or-kill-buffer)))
(provide 'setup-shell)