Skip to content
Find file
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"
"BASH completion hook")
(add-hook 'shell-dynamic-complete-functions
'bash-completion-dynamic-complete)
(add-hook 'shell-command-complete-functions
'bash-completion-dynamic-complete)
;; tab-completion for shell-command
(require 'shell-command)
(shell-command-completion-mode)
;; 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)))
(kill-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)
Jump to Line
Something went wrong with that request. Please try again.