1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-23 06:06:26 +08:00
ohmyzsh/plugins/per-directory-history
2013-03-13 13:07:32 -04:00
..
per-directory-history.plugin.zsh Update to latest per-directory-history 2013-02-28 10:28:08 -05:00
per-directory-history.zsh Update to latest per-directory-history 2013-03-13 13:07:32 -04:00
README.md Update to latest per-directory-history 2013-02-28 10:28:08 -05:00

Per-Directory-History

Per directory history for zsh, as well as global history, and the
ability to toggle between them with ^G.

This is a implementation of per directory history for zsh, some
implementations of which exist in bash1,2. It also implements
a per-directory-history-toggle-history function to change from using the
directory history to using the global history. In both cases the history is
always saved to both the global history and the directory history, so the
toggle state will not effect the saved histories. Being able to switch
between global and directory histories on the fly is a novel feature as far
as I am aware.

This is a standalone repository for the script, however it is also included in
oh-my-zsh as a plugin.


Usage

  1. Load this script into your interactive ZSH session:

    % source zsh-per-directory-history.zsh
    
  2. The default mode if per directory history, interact with your history as normal.

  3. Press ^G (the Control and G keys simultaneously) to toggle between local
    and global histories.


Configuration

  • HISTORY_BASE a global variable that defines the base directory in which the
    directory histories are stored
  • per-directory-history-toggle-history is the function to toggle the history

History

The idea/inspiration for a per directory history is from Stewart MacArthur
and Dieter, the implementation idea is from Bart Schaefer. The
implementation is by Jim Hester in September 2012.