my xfce4 dotfiles
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.

62 lines
2.6 KiB

3 years ago
  1. # Dirhistory plugin
  2. This plugin adds keyboard shortcuts for navigating directory history and hierarchy.
  3. To use it, add `dirhistory` to the plugins array in your zshrc file:
  4. ```zsh
  5. plugins=(... dirhistory)
  6. ```
  7. ## Keyboard Shortcuts
  8. | Shortcut | Description |
  9. |-----------------------------------|-----------------------------------------------------------|
  10. | <kbd>Alt</kbd> + <kbd>Left</kbd> | Go to previous directory |
  11. | <kbd>Alt</kbd> + <kbd>Right</kbd> | Go to next directory |
  12. | <kbd>Alt</kbd> + <kbd>Up</kbd> | Move into the parent directory |
  13. | <kbd>Alt</kbd> + <kbd>Down</kbd> | Move into the first child directory by alphabetical order |
  14. **For macOS: use the Option key (<kbd></kbd>) instead of <kbd>Alt</kbd>**.
  15. > NOTE: some terminals might override the <kbd>Alt</kbd> + Arrows key bindings (e.g. Windows Terminal).
  16. > If these don't work check your terminal settings and change them to a different keyboard shortcut.
  17. ## Usage
  18. This plugin allows you to navigate the history of previous working directories using <kbd>Alt</kbd> + <kbd>Left</kbd>
  19. and <kbd>Alt</kbd> + <kbd>Right</kbd>. <kbd>Alt</kbd> + <kbd>Left</kbd> moves to past directories, and
  20. <kbd>Alt</kbd> + <kbd>Right</kbd> goes back to recent directories.
  21. **NOTE: the maximum directory history size is 30.**
  22. You can also navigate **directory hierarchies** using <kbd>Alt</kbd> + <kbd>Up</kbd> and <kbd>Alt</kbd> + <kbd>Down</kbd>.
  23. <kbd>Alt</kbd> + <kbd>Up</kbd> moves to the parent directory, while <kbd>Alt</kbd> + <kbd>Down</kbd> moves into the first
  24. child directory found in alphabetical order (useful to navigate long empty directories, e.g. Java packages).
  25. For example, if the shell was started, and the following commands were entered:
  26. ```shell
  27. cd ~
  28. cd /usr
  29. cd share
  30. cd doc
  31. ```
  32. the directory stack (`dirs -v`) would look like this:
  33. ```console
  34. $ dirs -v
  35. 0 /usr/share/doc
  36. 1 /usr/share
  37. 2 /usr
  38. 3 ~
  39. ```
  40. then entering <kbd>Alt</kbd> + <kbd>Left</kbd> at the prompt would change directory from `/usr/share/doc` to `/usr/share`,
  41. then if pressed again to `/usr`, then `~`. If <kbd>Alt</kbd> + <kbd>Right</kbd> were pressed the directory would be changed
  42. to `/usr` again.
  43. After that, <kbd>Alt</kbd> + <kbd>Down</kbd> will probably go to `/usr/bin` if `bin` is the first directory in alphabetical
  44. order (depends on your `/usr` folder structure). <kbd>Alt</kbd> + <kbd>Up</kbd> will return to `/usr`, and once more will get
  45. you to the root folder (`/`).