A clean and customizable oh my zsh theme with Git integration, designed for dark terminals. It features a colorful prompt with dynamic Git branch and status indicators, and distinct ls
colors for files and directories.
-
Dynamic Prompt:
- Git Repositories: Displays
[path :: branch status] β
- Path and brackets in blue (
%F{75}
). - Separator
::
in white. - Branch name with color-coded branches:
main
/master
: Green (%F{40}
)dev
: Yellow (%F{226}
)feature-*
: Blue (%F{75}
)- Others: Orange (
%F{214}
)
- Git status indicators in yellow (
%F{226}
):*
: Modified or staged files+
: Untracked files!
: Merge conflicts
- Prompt arrow (
β
) in blue.
- Path and brackets in blue (
- Non-Git Directories: Displays
[path] β
- Path and brackets in blue.
- Prompt arrow in blue.
- Git Repositories: Displays
-
Colorful
ls
Output:- Directories: Bold blue
- Regular files: Default color
- Executables: Red
- Symbolic links: Cyan
- Other file types (sockets, pipes, etc.): Distinct colors
- Compatible with macOS (
ls -G
) and Linux (ls --color=auto
).
-
Lightweight and Optimized:
- Minimal code with efficient Git status checks.
- Clear structure for easy customization.
-
Clone or Copy the Theme:
- Save the theme file as
blue.zsh-theme
in your oh my zsh custom themes directory:cp blue.zsh-theme ~/.oh-my-zsh/themes/
- Save the theme file as
-
Set the Theme:
- Edit your
~/.zshrc
and set the theme:ZSH_THEME="blue"
- Apply changes:
source ~/.zshrc
- Edit your
-
Verify Setup:
- Navigate to a Git repository and check the prompt:
[path :: branch status] β
. - Navigate to a non-Git directory and check:
[path] β
. - Run
ls -lah
to confirm colorful file and directory output.
- Navigate to a Git repository and check the prompt:
- Zsh with oh my zsh installed.
- Terminal supporting 256 colors (
echo $TERM
should outputxterm-256color
or similar). - Optional: A font supporting emojis (e.g., Nerd Fonts) for better prompt rendering.
-
Change Colors:
- Edit color variables in the theme file (e.g.,
BLUE='%F{75}'
for path and arrow). - Use 256-color codes (e.g.,
%F{69}
for darker blue,%F{228}
for brighter yellow). - Test colors in your terminal to match your preferences.
- Edit color variables in the theme file (e.g.,
-
Modify Prompt:
- Adjust the
PROMPT
string inset_prompt
to change symbols or layout. - Example: Replace
β
with another symbol likeβ
or$
.
- Adjust the
-
Extend Git Status:
- Modify
parse_git_status
to add more Git indicators (e.g., ahead/behind remote).
- Modify
-
LS Colors:
- Customize
LSCOLORS
(macOS) orLS_COLORS
(Linux) for different file type colors. - Refer to
man dircolors
(Linux) orman ls
(macOS) for details.
- Customize
-
Prompt not displaying correctly?
- Ensure
ZSH_THEME="blue"
is set in~/.zshrc
. - Verify Git is installed and working (
git --version
). - Check if
is_git_repo
works: Rungit rev-parse --is-inside-work-tree
in a Git directory.
- Ensure
-
Colors not showing?
- Confirm your terminal supports 256 colors (
echo $TERM
). - Try adjusting color codes in the theme file.
- Confirm your terminal supports 256 colors (
-
LS colors not working?
- Ensure
CLICOLOR=1
(macOS) orls --color=auto
(Linux) is enabled. - Check
LSCOLORS
orLS_COLORS
syntax.
- Ensure
This theme is released under the MIT License. Feel free to modify and share!
Suggestions and pull requests are welcome! Please open an issue or submit a pull request on the repository (if hosted).
Happy coding with Blue ZSH Theme! π