2011-05-05 37 views
1

比如我想它不顯示匹配的模式*~如何讓Dired不顯示某些文件?

編輯的所有文件:以下工作:

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

回答

1

如果使用dired-X,read here,或杉木dired,閱讀this discussion。在dired的情況下,建議的解決方案使用正則表達式來過濾要顯示的內容並僅顯示這些文件。你的情況可能會有點棘手。

+0

你可以用這樣的正則表達式調用dired:'/ tmp/* [!〜]'。這個例子將列出沒有以'〜'結尾的文件名'/ tmp' – Juancho 2011-05-05 04:21:31

1

超級用戶回答了,但我也會在這裏回答。使用dired-omit

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一部分。