This is a implementation of per directory history for zsh, some
implementations of which exist in bash[1,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.
[1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html
[2]: http://dieter.plaetinck.be/per_directory_bash
the vi-mode plugin destroys any bindings made before it is sourced due to the
'bindkey -v' call to switch to using vi-mode. This patch saves the bindings
before invoking 'bindkey -v' then rebinds them afterwards, this fixes a number
of outstanding issues due to people using vi-mode and having things in oh-my-zsh
break due to the bindings being destroyed
For non-trailing path components, we show only the first character. So, as in Fish proper, we convert ~/some/really/really/really/long/path/name to ~/s/r/r/r/l/p/name.
The debian plugin calls which to determine whether aptitude & sudo are
installed. However, if these are not installed then the error output
from which will be output. Since this isn't really an error condition,
this commit updates the which calls to pipe stderr to stdout, thus
hiding the error messages.
This patch makes git_prompt_status support three new status variables:
- ZSH_THEME_GIT_PROMPT_AHEAD
- ZSH_THEME_GIT_PROMPT_BEHIND
- ZSH_THEME_GIT_PROMPT_DIVERGED
With these extra variables it's easy to see (1) if you have commits in
your local branch that weren't pushed to the remote (AHEAD), (2) if
there are commits in the remote that you haven't merged/rebased yet
(BEHIND) or (3) if you have local unpushed commits AND the remote has
some commits you haven't merged yet (DIVERGED).
Refer to the first line displayed on `git status -b --porcelain`.
An example setup in a .zsh-theme file would be:
ZSH_THEME_GIT_PROMPT_AHEAD="↑"
ZSH_THEME_GIT_PROMPT_BEHIND="↓"
ZSH_THEME_GIT_PROMPT_DIVERGED="↕"