首页 > 代码库 > emacs中eshell的快捷键配制

emacs中eshell的快捷键配制

eshell是emacs shell的简称,是emacs自带的shell.开始设置的时候还在想是否要找到它的key map (eshell-mode-map?).

原来它是采用hook设置,如下所示

(add-hook ‘eshell-mode-hook
          (lambda ()
            (local-set-key (kbd "C-j") ‘switch-to-buffer)
            (local-set-key (kbd "C-a") ‘eshell-bol)
            (local-set-key (kbd "C-c SPC") ‘ace-jump-mode)
            (local-set-key (kbd "<up>") ‘eshell-previous-matching-input-from-input)
            (local-set-key (kbd "<down>") ‘eshell-next-matching-input-from-input)))

这里,我将方向键上,下分别指定到向前和向后查找命令历史.这里要保存命令历史,采用以下配制:

(setq eshell-save-history-on-exit t)