1

Emacs ido 非常好,它让我的工作更有效率。

但是当她认为当前目录中与我输入的字符串不匹配时,总是需要自己更改目录,这让我感到相当恼火。虽然在大多数情况下,我希望她能留下来。

我知道有一些键盘映射可以解决这个问题:额外的C-f将返回正常find-file模式,并且C-j可用于强制 ido 使用当前目录。但是是否有任何设置使 ido 默认限制在当前目录?

4

1 回答 1

0

此功能称为auto-merge. 以下三个选项与该功能相关:

(defcustom ido-auto-merge-work-directories-length 0
  "Automatically switch to merged work directories during file name input.
The value is number of characters to type before switching to merged mode.
If zero, the switch happens when no matches are found in the current directory.
Automatic merging is disabled if the value is negative."
  :type 'integer
  :group 'ido)

(defcustom ido-auto-merge-delay-time 0.70
  "Delay in seconds to wait for more input before doing auto merge."
  :type 'number
  :group 'ido)

(defcustom ido-auto-merge-inhibit-characters-regexp "[][*?~]"
  "Regexp matching characters which should inhibit automatic merging.
When a (partial) file name matches this regexp, merging is inhibited."
  :type 'regexp
  :group 'ido)

例如,您可以延长延迟时间或禁用该功能。要禁用该功能,请将以下语句添加到您的.emacs

(setq ido-auto-merge-work-directories-length -1)

C-z键绑定也取消了最后一个auto-merge. 请参阅以下片段ido.el

(define-key map "\C-z" 'ido-undo-merge-work-directory)
于 2013-04-22T14:07:35.520 回答