dired.el 917 B

1234567891011121314151617181920212223242526
  1. (put 'dired-find-alternate-file 'disabled nil)
  2. (setq dired-listing-switches (purecopy "-alh")) ; Prettify dired
  3. (setq dired-hide-details-hide-symlink-targets nil)
  4. (defun wi-file-name-directory ()
  5. "Open dired which contains current file."
  6. (interactive)
  7. (dired (file-name-directory (file-truename (buffer-file-name)))))
  8. (with-eval-after-load 'dired
  9. (require 'dired-x)
  10. (setq dired-omit-files
  11. (concat dired-omit-files "\\|^\\..+$"))
  12. (setq dired-omit-files
  13. (concat dired-omit-files "\\|.*\\.~$"))
  14. (let ((map dired-mode-map))
  15. (define-key map (kbd "C-c x") 'crux-open-with)
  16. (define-key map (kbd "<f8>") 'crux-open-with)
  17. (define-key map (kbd "<home>") 'beginning-of-buffer)
  18. (define-key map (kbd "<end>") 'end-of-buffer)
  19. (define-key map (kbd "C-j") 'dired-find-file)
  20. (define-key map (kbd "<mouse-2>") 'crux-open-with))
  21. (add-hook 'dired-mode-hook 'dired-omit-mode))