处于直接模式时执行“切换到缓冲区”

时间:2013-11-14 20:52:53

标签: emacs elisp

我的.emacs文件中有以下内容:

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

然而,当我处于直接模式“查看目录”时,M-s不会执行“切换到缓冲区”,而是显示M-s等待更多输入。

在直接模式下,如何使切换到缓冲区工作?

1 个答案:

答案 0 :(得分:2)

M-s现在是Isearch前缀键。在Dired模式下,默认情况下你有这些绑定(从'emacs -Q'尝试M-s C-h):

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会显示该键映射中的所有键。

相关问题