4

I found ido to be very helpful in finding files (C-x C-f) and buffers (C-x b) especially with flex matching enabled. I also installed smex (built on top of ido) in order to do the same thing with commands. Is it possible to use ido to complete words in the open buffer?

For example, in a buffer which contains these words stackoverflow-questions stackoverflow-tags stackoverflow-users, sofq should complete to stackoverflow-questions.

4

1 回答 1

2

IDO 有一大堆各种各样的辅助函数,这些函数很容易让一个人精炼成可用的组件。下面的函数片段出奇地快,但不能与现有的完成方式完美集成:

(defun buffer-completion ()
  "Use IDO to pick completion matches from current buffer."
  (interactive)
  (let ((words (split-string (buffer-string))))
    (insert (ido-completing-read "Word completion:" words)))

为了进一步平滑完成我们的使用,我们可以使用thing-at-point或等效函数来跳过分散注意力的 minibuffer 提示。

于 2013-06-05T15:52:17.460 回答