如何使emacs-helm列表提供当前目录中的文件作为选项? [英] How to have emacs-helm list offer files in current directory as options?

查看:98
本文介绍了如何使emacs-helm列表提供当前目录中的文件作为选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

解决方案

你会发现 helm-mini 定义为:



$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ )
(helm-other-buffer'(helm-c-source-buffers-list
helm-c-source-recentf
helm-c-source-buffer-not-found)
* helm mini *))

所以它只是使用源列表进行调用。添加任何现有的资源很容易。



使用 helm-mode 启用运行 Ch v < kbd> helm-c-source files (注意空格),你应该找到:


helm-c- source-files-in-current-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-preference-list 为您感兴趣的其他来源。并使用帮助系统来发现新的好东西。


Is there a way from the helm-mini command to list includes files in the current directory as part of potential search matches?

解决方案

You'll find helm-mini defined as:

(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*"))

so it just calls with a list of sources. It's very easy to add any existing source.

With helm-mode enabled run C-h vhelm-c-source files (note space) and you should find:

helm-c-source-files-in-current-dir

So make your own helm command with the sources you need:

(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*"))

Check out the definition of helm-for-files-prefered-list for other sources that might interest you. And use the help system to discover new goodies.

这篇关于如何使emacs-helm列表提供当前目录中的文件作为选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆