LoginSignup
2
1

More than 3 years have passed since last update.

Hide .DS_Store file from Emacs

Last updated at Posted at 2019-08-08

.DS_Store ファイルをMacから削除する…というTipsは山ほどあるのですが、いづれも一時的でいつの間にかまた復活してしまいます。なので私の場合は、Emacsの各シーンで .DS_Store が非表示になるように設定しています。

counsel-find-file

(setq counsel-find-file-ignore-regexp (regexp-opt '(".DS_Store")))

dired

;; omit .DS_Store
(require 'dired-x)
(setq-default dired-omit-files-p t)
(setq dired-omit-files "^\\.DS_Store")

neotree

;; Patched to allow everything but .DS_Store
;; Tips from https://github.com/syl20bnr/spacemacs/issues/2751
(with-eval-after-load 'neotree
  (defun neo-util--walk-dir (path)
    "Return the subdirectories and subfiles of the PATH."
    (let* ((full-path (neo-path--file-truename path)))
      (condition-case nil
      (directory-files
       path 'full "^\\([^.]\\|\\.[^D.][^S]\\).*")
    ('file-error
     (message "Walk directory %S failed." path)
     nil)))))
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1