ohmyzsh/lib
Hemna 0b8a9d1de2 Added git_files_changed function
This patch adds the git library function for building a
short string that represents the output of git diff --numstat.
This gives theme designers the ability to add the
Number of files changed, number of lines added and number of
lines removed in their prompt for a git repository, while the user's
current working directory is in the git repo.

The new function supports prefix and suffix for each of the
options, files changed, lines added and lines removed.

To colorize the output, you can do something like this in your
theme file

ZSH_THEME_GIT_FILES_CHANGED_PREFIX="%{$fg[yellow]%}"
ZSH_THEME_GIT_FILES_CHANGED_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_LINES_ADDED_PREFIX="%{$fg[green]%}"
ZSH_THEME_GIT_LINES_ADDED_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_LINES_REMOVED_PREFIX="%{$fg[red]%}"
ZSH_THEME_GIT_LINES_REMOVED_SUFFIX="%{$fg[blue]%}"

For example, if there are
3 files changed, 10 lines added and no lines removed you will get
3f:10+

1 files changed, 20 lines added and 6 lines removed:
1f:20+:6-
2021-01-25 08:11:02 -05:00
..
bzr.zsh Modification to the frisk theme to work with the BZR lib 2013-11-06 20:10:59 -02:00
cli.zsh fix(CLI): show symlinked themes in omz theme list 2021-01-05 19:09:57 +01:00
clipboard.zsh lib: add support for clippaste in WSL using powershell 2020-02-28 19:07:05 +01:00
compfix.zsh compfix: fix check for empty string (#7674) 2019-03-21 20:35:00 +01:00
completion.zsh Revert "lib: treat _ and - as part of a word" 2020-10-21 16:02:34 +02:00
correction.zsh Don't correct cp commands (#4636) 2018-07-01 22:43:45 +02:00
diagnostics.zsh Prefix cd calls with builtin (#8937) 2020-05-20 11:30:11 +02:00
directories.zsh init: run compinit before loading lib/ files 2019-05-07 21:30:06 +02:00
functions.zsh fix(lib): use -N syntax in head and tail to support Solaris (#6391) 2021-01-16 18:59:24 +01:00
git.zsh Added git_files_changed function 2021-01-25 08:11:02 -05:00
grep.zsh lib: use grep-alias cache only if ZSH_CACHE_DIR is writable 2020-03-02 12:35:58 +01:00
history.zsh Revert "lib: remove share_history" 2020-11-09 12:00:15 +01:00
key-bindings.zsh lib: remove CTRL-Backspace key binding altogether 2020-08-06 08:55:29 +02:00
misc.zsh lib: speed up slow parts of the lib files; other small fixes 2020-04-05 21:37:45 +02:00
nvm.zsh nvm: simplify nvm.sh and bash completion loading 2020-10-09 17:21:03 +02:00
prompt_info_functions.zsh Themes: switch to using ruby_prompt_info() 2019-05-08 08:45:34 +02:00
spectrum.zsh lib: speed up slow parts of the lib files; other small fixes 2020-04-05 21:37:45 +02:00
termsupport.zsh fix(lib): update Emacs terminal detection in title function (#9577) 2021-01-07 20:55:18 +01:00
theme-and-appearance.zsh lib: prefix diff call with command to bypass diff aliases 2020-07-06 17:17:40 +02:00