I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.6 KiB

  1. #+TITLE: Dired
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle dired.el :comments org
  5. #+PROPERTY: header-args :results silent :eval no-export :comments org
  6. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  7. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  8. Emacs has a built-in directory editor.
  9. * Config
  10. Emacs has some really amazing built-in packages, and ~dired~[fn:1] is one of them. It completly coveres everything you would expect from a file manager, but it's not perfect out of the box.
  11. ** Current directory
  12. I don't want to press =RET= twice to navigate to the current directory. There's a way to get around this problem with ~jump~, included in the ~dired-x~ package, included with Emacs.
  13. #+begin_src emacs-lisp
  14. (require 'dired-x)
  15. #+end_src
  16. ** Reusing the same buffer
  17. By default, ~dired~[fn:1] will create a new buffer each time you press =RET= over a directory. This leads to unwanted buffers all over the place. Avoid this behaviour with ~dired-single~[fn:2], reusing the same ~dired~ buffer.
  18. + Move up a directory with =h=
  19. + Open a single buffer with =l=
  20. #+begin_src emacs-lisp
  21. (use-package dired-single
  22. :config (evil-collection-define-key 'normal 'dired-mode-map
  23. "h" 'dired-single-up-directory
  24. "l" 'dired-single-buffer))
  25. #+end_src
  26. * Shortcuts
  27. Open a new dired buffer using the ~jump~ command with =SPC d=.
  28. #+begin_src emacs-lisp
  29. (dotfiles/leader
  30. "d" '(dired-jump :which-key "Dired"))
  31. #+end_src
  32. * Footnotes
  33. [fn:1] https://en.wikipedia.org/wiki/Dired
  34. [fn:2] https://github.com/crocket/dired-single