2013-11-14 136 views
1

我已經在我的.emacs文件如下:執行「切換到緩衝區」,而在dired模式

(global-set-key "\M-s" 'switch-to-buffer) 

然而,當我在dired模式「查看目錄」 MS犯規實行「開關而是顯示Ms等待更多的輸入。

如何在直通模式下切換到緩衝區工作?

+0

在最新版本的Emacs Trunk上,這裏是dired keymap賦值:;;我搜索; '(define-key map(kbd「M-s a C-s」)'dired-do-isearch)'; '(define-key map(kbd「M-s a M-C-s」)'dired-do-isearch-regexp)'; '(define-key map(kbd「M-s f C-s」)'dired-isearch-filenames)'; '(define-key map(kbd「M-s f M-C-s」)'dired-isearch-filenames-regexp)'。因此,您需要將這些'dired-mode-map'分配設置爲'nil'或其他內容,或者重新定義您的鍵盤快捷鍵以切換到緩衝區。 – lawlist

+0

得到是...謝謝。 – SFbay007

+0

'(define-key dired-mode-map(kbd「Ms s」)'switch-to-buffer)' – lawlist

回答

2

M-s現在是Isearch前綴密鑰。在Dired模式,你有這些綁定在默認情況下(試圖從M-s C-h emacs的`-Q'):

Major Mode Bindings Starting With M-s: 
key    binding 
---    ------- 

M-s a  Prefix Command 
M-s f  Prefix Command 

M-s f C-s dired-isearch-filenames 
M-s f ESC Prefix Command 

M-s a C-s dired-do-isearch 
M-s a ESC Prefix Command 

M-s f C-M-s dired-isearch-filenames-regexp 

M-s a C-M-s dired-do-isearch-regexp 



Global Bindings Starting With M-s: 
key    binding 
---    ------- 

M-s .  isearch-forward-symbol-at-point 
M-s _  isearch-forward-symbol 
M-s h  Prefix Command 
M-s o  occur 
M-s w  isearch-forward-word 

M-s h .  highlight-symbol-at-point 
M-s h f  hi-lock-find-patterns 
M-s h l  highlight-lines-matching-regexp 
M-s h p  highlight-phrase 
M-s h r  highlight-regexp 
M-s h u  unhighlight-regexp 
M-s h w  hi-lock-write-interactive-patterns 

所以你結合M-s的東西不同的選擇是不是一個偉大的選擇,對於Dired模式和一般。你可以這樣做,但是你必須定義一個不同的Isearch前綴密鑰,或者不用在前綴密鑰上使用Isearch命令。

請記住,當Emacs似乎在等待更多密鑰時,您可能鍵入了一個前綴密鑰。請記住,您可以(通常)鍵入前綴鍵,然後點擊C-h以查看具有該前綴的鍵。

如果您使用的庫help-fns+.el那麼你可以使用C-h M-kdescribe-keymap)來獲取所有綁定到一個變量給定的鍵盤佈局定義的(非菜單)鍵的人類可讀上市。在這種情況下,C-h M-k dired-mode-map向您顯示該鍵盤映射中的所有鍵。

相關問題