问题 如何让emacs-helm list提供当前目录中的文件作为选项?


有没有办法 helm-mini 列表命令包括当前目录中的文件作为潜在搜索匹配的一部分?


12516
2017-07-09 22:01


起源



答案:


你会找到 helm-mini 定义为:

(defun helm-mini ()
  "Preconfigured `helm' lightweight version \(buffer -> recentf\)."
  (interactive)
  (helm-other-buffer '(helm-c-source-buffers-list
                       helm-c-source-recentf
                       helm-c-source-buffer-not-found)
                     "*helm mini*"))

所以它只是调用一个来源列表。添加任何现有源都非常容易。

helm-mode 启用运行 C-h诉helm-c-source文件 (注意空间)你应该找到:

掌舵-C-源文件,在电流-DIR

因此,使用您需要的源创建自己的helm命令:

(defun helm-my-buffers ()
  (interactive)
  (helm-other-buffer '(helm-c-source-buffers-list
                       helm-c-source-files-in-current-dir
                       helm-c-source-recentf
                       helm-c-source-buffer-not-found)
                     "*helm-my-buffers*"))

看看的定义 helm-for-files-prefered-list 对于您可能感兴趣的其他来源。并使用帮助系统发现新的好东西。


15
2017-07-10 00:26



谢谢,这非常有用。我不是百分百肯定,但我认为 helm-c-source-* 变量已重命名为 helm-source-* 在更新的版本中。 - cjauvin


答案:


你会找到 helm-mini 定义为:

(defun helm-mini ()
  "Preconfigured `helm' lightweight version \(buffer -> recentf\)."
  (interactive)
  (helm-other-buffer '(helm-c-source-buffers-list
                       helm-c-source-recentf
                       helm-c-source-buffer-not-found)
                     "*helm mini*"))

所以它只是调用一个来源列表。添加任何现有源都非常容易。

helm-mode 启用运行 C-h诉helm-c-source文件 (注意空间)你应该找到:

掌舵-C-源文件,在电流-DIR

因此,使用您需要的源创建自己的helm命令:

(defun helm-my-buffers ()
  (interactive)
  (helm-other-buffer '(helm-c-source-buffers-list
                       helm-c-source-files-in-current-dir
                       helm-c-source-recentf
                       helm-c-source-buffer-not-found)
                     "*helm-my-buffers*"))

看看的定义 helm-for-files-prefered-list 对于您可能感兴趣的其他来源。并使用帮助系统发现新的好东西。


15
2017-07-10 00:26



谢谢,这非常有用。我不是百分百肯定,但我认为 helm-c-source-* 变量已重命名为 helm-source-* 在更新的版本中。 - cjauvin