Need help with per-directory-history?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

jimhester
165 Stars 25 Forks zlib License 24 Commits 19 Opened issues

Description

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

Services available

!
?

Need anything else?

Contributors list

# 6,640
Shell
R
travis-...
codecov
12 commits
# 185,180
passwor...
C
C++
osx
1 commit
# 309,944
Clojure
Shell
logging
HTML
1 commit
# 86,242
Common ...
emacs-l...
Emacs
solidit...
1 commit
# 32,236
TypeScr...
React
Vue.js
vscode-...
1 commit
# 105,403
Shell
Lua
PHP
Sublime...
1 commit
# 72,018
C#
Shell
CSS
python3...
1 commit
# 462,302
Shell
CSS
HTML
sequenc...
1 commit
# 357,673
depende...
F#
Shell
f-sharp
1 commit

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. If you would prefer a different shortcut to toggle set the PERDIRECTORYHISTORY_TOGGLE environment variable.


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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.