首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何让Dired不显示某些文件?

如何让Dired不显示某些文件?
EN

Stack Overflow用户
提问于 2011-05-05 10:54:07
回答 2查看 323关注 0票数 1

例如,我希望它不显示与模式*~匹配的所有文件

编辑:如下所示:

代码语言:javascript
复制
(add-hook 'dired-load-hook
      (lambda ()
        (load "dired-x")
        ;; Set dired-x global variables here.  For example:
        ;; (setq dired-guess-shell-gnutar "gtar")
        ;; (setq dired-x-hands-off-my-keys nil)
        ))
(setq dired-omit-files "^#\\|~$")
(add-hook 'dired-mode-hook
      (lambda ()
        ;; Set dired-x buffer-local variables here.  For example:
        (dired-omit-mode 1)
        ))
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-05-05 11:06:15

如果使用dired-x、read here或fir dired,请阅读this discussion。在dired的情况下,建议的解决方案采用正则表达式,该正则表达式将过滤出要显示的内容,并仅显示这些文件。在您的情况下,这可能有点棘手。

票数 1
EN

Stack Overflow用户

发布于 2011-05-08 20:30:02

在SuperUser上回答了,但我也会在这里回答。使用dired-omit

代码语言:javascript
复制
Dired-Omit minor mode (indicator Omit):
Toggle Dired-Omit mode.
With numeric ARG, enable Dired-Omit mode if ARG is positive, disable
otherwise.  Enabling and disabling is buffer-local.
If enabled, "uninteresting" files are not listed.
Uninteresting files are those whose filenames match regexp `dired-omit-files',
plus those ending with extensions in `dired-omit-extensions'.

dired-omitdired-x的一部分。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5892127

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档