5

我经常使用dired-mode,最近开始使用ido

(ido-mode 1); enable ido-mode
(setq ido-enable-flex-matching t); flexibly match names via fuzzy matching
(setq ido-everywhere t); use ido-mode everywhere, in buffers and for finding files
(setq ido-use-filename-at-point 'guess); for find-file-at-point
(setq ido-use-url-at-point t); look for URLs at point
(setq ffap-require-prefix t); get find-file-at-point with C-u C-x C-f 

当我在 dired 缓冲区中复制文件(带有C)时,我仍然必须使用“标准方式”来提供文件复制到的新位置。这意味着,我必须使用标准的 TAB 补全,但没有ido-completion。这同样适用于R移动文件等。因此我想知道是否有可能ido也作用于CR在 dired 缓冲区中?

4

2 回答 2

6

看起来我遇到了同样的问题。一些调查表明,我们需要覆盖read-file-name-function默认情况下调用的变量read-file-name-function-default。但是,查看源代码ido-everywhere(这是一个次要模式),它为我们做到了这一点。

解决方案:

而不是这样做(setq ido-everywhere t),将其替换为:

(ido-everywhere t)

这为我修复了它,导致ido-read-file-name在您使用C或类似时在 dired 缓冲区中被调用。

另外的选择:

您也可以考虑以下增强版ido-everywhere

https://github.com/DarwinAwardWinner/ido-ubiquitous

;;; Commentary:

;; You may have seen the `ido-everywhere' variable in ido.el and got
;; excited that you could use ido completion for everything. Then you
;; were probably disappointed when you realized that it only applied
;; to *file names* and nothing else. Well, ido-ubiquitous is here to
;; fulfill the original promise and let you use ido completion for
;; (almost) any command that uses `completing-read' to offer you a
;; choice of several alternatives.
于 2012-07-16T15:39:09.547 回答
3

我发现(put 'dired-do-rename 'ido 'find-file)R 键可以正常工作,如果您需要停在您只需按下C-j而不是完成文件名的路径上。

于 2013-01-05T17:28:56.903 回答