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.

48 lines
2.0 KiB

3 years ago
  1. per-directory-history plugin
  2. ----------------------------
  3. This plugin adds per-directory history for zsh, as well as a global history,
  4. and the ability to toggle between them with a keyboard shortcut. This is a
  5. bundle of the [official plugin by @jimhester][5].
  6. To use it, add `per-directory-history` to the plugins array in your zshrc file:
  7. ```zsh
  8. plugins=(... per-directory-history)
  9. ```
  10. This is an implementation of per-directory history for zsh, some implementations
  11. of which exist in bash[1][],[2][]. It also implements a toggle-history function
  12. to change from using the directory history to using the global history. In both
  13. cases the history is always saved to both the global history and the directory
  14. history, so the toggle state will not effect the saved histories. Being able to
  15. switch between global and directory histories on the fly is a novel feature.
  16. ## Usage
  17. The default mode is per directory history, interact with your history as normal.
  18. Press ^G (the <kbd>Control</kbd> and <kbd>G</kbd> keys simultaneously) to toggle
  19. between local and global histories. If you would prefer a different shortcut to
  20. toggle set the `PER_DIRECTORY_HISTORY_TOGGLE` environment variable.
  21. ## Configuration
  22. * `HISTORY_BASE` is a global variable that defines the base directory in which the
  23. directory histories are stored (default `$HOME/.directory_history`).
  24. * `per-directory-history-toggle-history` is the function to toggle between local
  25. and global histories.
  26. * `PER_DIRECTORY_HISTORY_TOGGLE` is the key binding used to run the toggle-history
  27. function above (default `^G`)
  28. ## History
  29. The idea/inspiration for a per directory history is from [Stewart MacArthur][1]
  30. and [Dieter][2], the implementation idea is from [Bart Schaefer][3]. The
  31. implementation is by [Jim Hester][4] in September 2012.
  32. [1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html
  33. [2]: http://dieter.plaetinck.be/per_directory_bash
  34. [3]: https://www.zsh.org/mla/users/1997/msg00226.html
  35. [4]: https://jimhester.com
  36. [5]: https://github.com/jimhester/per-directory-history