jimhester / per-directory-history

Per directory history for zsh, as well as global history, and the ability to toggle between them with ^G.
zlib License
259 stars 36 forks source link

Start in global history mode? #20

Closed IgnusG closed 6 years ago

IgnusG commented 6 years ago

Is there a way to start the shell with the global mode on and only switch to the directory specific one with the keyboard shortcut?

I usually use the global history but it would be helpful to sometimes only see what I executed in a certain directory, where this plugin would come in handy.


Thanks for the help!

jimhester commented 6 years ago

You can call _per-directory-history-set-global-history after sourcing the script and it would change to global history.

IgnusG commented 6 years ago

Perfect! Thanks a lot ;)

NodeJSmith commented 6 days ago

For anyone stumbling upon this years later, this seems to be supported out of the box now with the variable HISTORY_START_WITH_GLOBAL, e.g. export HISTORY_START_WITH_GLOBAL=true

https://github.com/jimhester/per-directory-history/blob/6363a60d2b63383eea4b42c1e115ff6c72a5cda9/per-directory-history.zsh#L60