Tuesday, February 23, 2010

Emacs: shell-pop

"shell-pop" is an Emacs mode that enables pop-up a window of terminal by typing
Ctrl + t

this is mush quicker than switching buffers to eshell to ansi-mode

require shell-pop.el from
http://www.emacswiki.org/emacs-en/ShellPop

in .emacs


;; shell-pop
;; C-tでshellをポップアップ
(require 'shell-pop)
(shell-pop-set-internal-mode "ansi-term") ;; ansi-termを使うよ
(shell-pop-set-internal-mode-shell "/bin/zsh") ;; zshを使うよ
(defvar ansi-term-after-hook nil)
(add-hook 'ansi-term-after-hook
          '(lambda ()
             (define-key term-raw-map "\C-t" 'shell-pop)))
(defadvice ansi-term (after ansi-term-after-advice (org))
  "run hook as after advice"
  (run-hooks 'ansi-term-after-hook))
(ad-activate 'ansi-term)
(global-set-key "\C-t" 'shell-pop)

No comments:

Post a Comment