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