A Highly Customize-able prompt for your shell
- Python3
- Powerline Fonts : https://github.com/powerline/fonts
- from pip
pip install hyper-prompt
- from github
git clone https://github.com/artbycrunk/hyper-prompt
cd hyper-prompt
python setup.py install
Add the following to your .bashrc
file:
# enable hyper-prompt if executable exists
if hash hyper-prompt 2>/dev/null; then
function _update_ps1() {
PS1=$(hyper-prompt --shell bash $?)
}
if [[ $TERM != linux && ! $PROMPT_COMMAND =~ _update_ps1 ]]; then
PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
fi
fi
Add the following to your .zshrc
:
function prompt_precmd() {
PS1="$(hyper-prompt --shell zsh $?)"
}
function add_prompt_precmd() {
for s in "${precmd_fn[@]}"; do
if [ "$s" = "prompt_precmd" ]; then
return
fi
done
precmd_fn+=(prompt_precmd)
}
if [ "$TERM" != "linux" ]; then
add_prompt_precmd
fi
Add the following to your ~/.config/fish/config.fish
:
function fish_prompt
hyper-prompt --shell bare $status
end
Add the following to your .tcshrc
:
alias precmd 'set prompt="`hyper-prompt --shell tcsh $?`"'
Hyper prompt will lookup multiple locations for a config file for options on how to display your prompt..
It will first look for a hyper_prompt.json
in your current project/folder, if it doesn't exists look for $HOME/.hyper_prompt.json
else finally look for $HOME/.config/hyper_prompt/config.json
Use ~/.config/hyper-prompt/config.json
as a config file for customizations.
Example of a default config
"theme": "default",
"mode":"patched",
"segments": [
"username",
{
"type": "virtual",
// a user built segment which is discoverable via the python path
"module": "hyper_prompt.segments.virtual"
}
]
Segments are the building blocks of hyper-prompt
You can mix and match different segments to build your prompt.
- If you come across a problem with the extension, please file an issue
- Contributions are always welcome!
- Any and all feedback is appreciated and welcome!
- If someone has already filed an issue that encompasses your feedback, please leave a 👍/👎 reaction on the issue
- Otherwise please file a new issue
See CHANGELOG.md
See Recent Releases
Enjoy!