日本語のREADMEも用意してあります。
Note: Syantax highlighting is not included.
- Prowpt - Simple, lightweight, and customizable Powerline-like prompt theme for Bash and Zsh
- Easy to manage plugin with common plugin managers like Zinit, or Oh-My-Zsh, e.t.c.
- The display and colors change depending on the Git branch state.
- Python virtualenv environments displaying
- Easy to custom due to simpler code
- Many customizable variables
- Lightweight repository
- Bash or Zsh shell
It does not work on Fish Shell. - Git command
- Nerd Fonts
It needs Nerd Fonts to use glyphs. - Terminal emulator that can display 256 colors.
Python virtualenv environment name will be displayed when you are in the environment.
If there is/are
- unstaged file(s):
*
- staged file(s):
+
- something stashed:
$
- untracked file(s):
%
HEAD and upstream defference
- behind:
<
- ahead:
>
- diverged:
<>
- up-to-date:
=
- Clone the repository
git clone https://github.com/alpaca-honke/prowpt.git ~/.prowpt/
- Add the following line below the
PS1
settings in~/.bashrc
source ~/.prowpt/prowpt.bash
- Restart your terminal
- Run the following command
sheldon add prowpt --github alpaca-honke/prowpt --use '*.bash' --branch main
- Restart your terminal
- Clone the repository
git clone https://github.com/alpaca-honke/prowpt.git ~/.prowpt/
- Comment out the following line in
~/.zshrc
autoload -Uz promptinit promptinit prompt adam1
- Add the following line in
~/.zshrc
source ~/.prowpt/prowpt.plugin.zsh
- Restart your terminal
- Clone the repository
git clone https://github.com/alpaca-honke/prowpt.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/prowpt/
- Add
prowpt
to the list of plugins for Oh-My-Zsh in the~/.zshrc
plugins=( #other plugins prowpt )
- Restart your terminal
- Add the following line to
~/.zshrc
zinit light alpaca-honke/prowpt
- Restart your terminal
- Run or write in the
.zshrc
the following commandantigen bundle alpaca-honke/prowpt --branch=main
- Restart your terminal
- Add the following line to
~/.zshrc
zplug "alpaca-honke/prowpt", as:plugin, at:main
- Restart your terminal
- Run the following command
sheldon add prowpt --github alpaca-honke/prowpt --branch main
- Restart your terminal
You can easily to custom it using ~/.config/prowpt/config.sh
.
- Create a directory
mkdir ~/.config/prowpt/
- Edit config file (You can use other text editors.)
vim ~/.config/prowpt/config.sh
You can easily to custom prompt by setting some variables like this:
PROWPT_SEGMENT_SEPARATOR=$'\ue0b8'
PROWPT_CURRENT_TIME_BG="5"
GIT_PS1_SHOWUPSTREAM=""
Variables | Description | Default |
---|---|---|
PROWPT_CURRENT_TIME | First segment value | Bash: \t , Zsh: %* |
PROWPT_USER | Second segment value | Bash: \u , Zsh: %n |
PROWPT_HOST | Third segment value | Bash: \h , Zsh: %m |
PROWPT_PROMPT | Last (second line) segment value | Bash: $ , Zsh: %# |
PROWPT_GIT_HEAD_BRANCH | An icon that is shown when current HEAD is a branch in Git repos | $'\ue0a0' |
PROWPT_GIT_HEAD_DETACHED | An icon that is shown when current HEAD is a detached HEAD in Git repos | $\ue729' |
Set the delimiter for segment (the block of the prompt).
You can set the delimiter using unicode like $'\ue0b0'
.
There is a list of commonly used delimiters.
Note: You can use e0b1, e0b5, e0b9, e0bb, e0c1, e0cd for the PWD delimiter, and any other character in the list for segment delimiters.
If you want to use vertical segment delimiters, set PROWPT_SEGMENT_DELIMITER=""
. The same as for PWD delimiters, you can use |
(pipe).
Variables | Description | Default |
---|---|---|
PROWPT_SEGMENT_DELIMITER | Segment delimiter | $'\ue060' |
PROWPT_PWD_DELIMITER | Current directory delimiter instead of / |
$'\ue0b1' |
If you want to highlight your home directory, set
PROWPT_PWD_HOME_HIGHLIGHT="yes"
.
If not,
set PROWPT_PWD_HOME_HIGHLIGHT="no"
or any other value.
You can set prompt colors using ANSI 256 colors.
256 Colors Cheat Sheet
Variables | Description | Default |
---|---|---|
PROWPT_CURRENT_TIME_FG | First segment foreground color | 253 |
PROWPT_CURRENT_TIME_BG | First segment background color | 31 |
PROWPT_USER_FG | Second segment foreground color | 253 |
PROWPT_USER_BG | Second segment background color | 242 |
PROWPT_HOST_FG | Third segment foreground color | 253 |
PROWPT_HOST_BG | Third segment background color | 239 |
PROWPT_PWD_FG | PWD segment foreground color | 253 |
PROWPT_PWD_BG | PWD segment background color | 237 |
PROWPT_PWD_DELIMITER_FG | PWD delimiter foreground color | 250 |
PROWPT_PWD_HOME_FG | Home directory segment foreground color (when you set PROWPT_PWD_HOME_HIGHLIGHT="yes" ) |
253 |
PROWPT_PWD_HOME_BG | Home directory segment background color (when you set PROWPT_PWD_HOME_HIGHLIGHT="no" ) |
31 |
PROWPT_GIT_FG | Git status segment foreground color | 236 |
PROWPT_GIT_BG | Git status segment background color | 148 |
PROWPT_GIT_DIRTY_FG | Git status segment foreground color when working tree is dirty | 253 |
PROWPT_GIT_DIRTY_BG | Git status segment background color when working tree is dirty | 166 |
PROWPT_GIT_STAGED_FG | Git status segment foreground color when there are some staged files | 236 |
PROWPT_GIT_STAGED_BG | Git status segment background color when there are some staged files | 178 |
PROWPT_GIT_DETACHED_FG | Git status segment background color when current HEAD is a detached HEAD | 253 |
PROWPT_GIT_DETACHED_BG | Git status segment foreground color when current HEAD is a detached HEAD | 103 |
PROWPT_PROMPT_FG | Last (second line) segment foreground color | 253 |
PROWPT_PROMPT_BG | Last (second line) segment background color | 237 |
PROWPT_PROMPT_ERROR_FG | Last (second line) segment foreground color (when exit status is not 0) | 253 |
PROWPT_PROMPT_ERROR_BG | Last (second line) segment background color (when exit status is not 0) | 5 |
This segment uses https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh.
The customizable variables follow this script.
Variables | Description | Default |
---|---|---|
GIT_PS1_SHOWDIRTYSTATE | If you set it to a noempty value, unstaged (*) and staged (+) changes will be shown next to the branch name. | yes |
GIT_PS1_SHOWSTASHSTATE | By setting it to a nonempty value, if something is stashed, then a '$' will be shown next to the branch name. | yes |
GIT_PS1_SHOWUNTRACKEDFILES | If you set it to a nonempty value, then a '%' will be shown next to the branch name if there're untracked files. | yes |
GIT_PS1_SHOWUPSTREAM | If you set GIT_PS1_SHOWUPSTREAM="auto" , then the difference betweeen HEAD and its upstream will be shown next to the branch name. A "<" indicates you are behind, ">" indicates you are ahead, "<>" indicates you have diverged and "=" indicates that there is no difference. |
auto |
See https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh or prowpt/git-prompt.sh for details. Other customizable variables are also written there.
If you want to custom but there are no customizable variables for it, overwrite prowpt-core.sh
or any other files.
I know this program is not complete.We welcome your contribution to this program. If you are willing to contribute, please make some pull requests.
- Fork this repository
- Make changes to forked repo
- Make pull request(s) to alpaca-honke/prowpt develop branch
In the same way, open an issue if you find some problems or need more features.
If there is/are some bugs or other problems,
- Open an issue if it is about this program.
- If you don't have a GitHub account, or have other reasons to think you shouldn't open an issue of it, contact me with the contact address below.
These are commonly used addresses. See alpaca-honke.github.io for other addresses.
- Fediverse (Activity Pub)
- Discord @alpaca_honke
- Email akp@ymail.ne.jp
- (Twitter: Twitter @alpaca_honke)
Prowpt is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.0 of the License.
Prowpt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See COPYING or GNU General Public Licence version 2.0, and Licenses - GNU Project - Free Software Foundation for more details.
Copyright (C) 2023 あるかっぱ/アルパカ本家 Alkappa/alpaca-honke