This prompt is a specialisation of repository called "Informative git prompt for zsh" for Kali Linux, which you can find here. Thanks to its author for the idea and implementation!
A zsh
prompt that displays information about the current git repository. In particular the branch name, difference with remote branch, number of files staged, changed, etc.
You can find all the repository state designations in the zsh-git-kali-prompt.zsh
file by copying the repository.
In order for git prompt for Linux to work, the following components must be installed on your local machine:
- Git.
- Python 3. In scripts, references to Python 3 appear as
python3
. If you havepython
installed, create a symbolic or hard-drive link with theln
command topython3
, or simply rename them in thezsh-git-kali-prompt.zsh
file. - For the git information prompt to work correctly, your Kali Linux must use the
zsh
UNIX command shell.
- Use the standard installation methods specific to your plugin under zsh.
-
Clone this repository to the $HOME directory or some other location (I'll do it in $HOME, and use that as the path in the future).
-
Source the file
zsh-git-kali-prompt.plugin.zsh
from your~/.zshrc
config file, and configure your prompt. So, somewhere (might be in the end of the file) in~/.zshrc
(recommended at the end of the file), you should have:# zsh git prompt setup. source $HOME/zsh-git-kali-prompt/zsh-git-kali-prompt.plugin.zsh
-
Restart the console, or write the
zsh
command to start a new session with the applied changes to the~/.zshrc
settings. -
Go in a git repository and test it! This only works if you are in a repository.
To remove the git command prompt, you need to remove the entire zsh-git-kali-prompt
directory (where all the prompt scripts are located), and lines in ~/.zshrc
that you added there during installation.
- You may redefine the function
git_super_status
(after thesource
statement) to adapt it to your needs (to change the order in which the information is displayed). - Define the variable
ZSH_THEME_GIT_PROMPT_CACHE
in order to enable caching. - You may also change a number of variables (which name start with
ZSH_THEME_GIT_PROMPT_
) to change the appearance of the prompt. Take a look in the filezsh-git-kali-prompt.zsh
to see how the functiongit_super_status
is defined, and what variables are available.