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 larn (
%F{75}). - Separator
::in white. - Branch name with color-coded branches:
main/master: Green (%F{40})dev: Yellow (%F{226})feature-*: Larn (%F{75})- Others: Orange (
%F{214})
- Git status indicators in yellow (
%F{226}):*: Modified or staged files+: Untracked files!: Merge conflicts
- Prompt arrow (
➜) in larn.
- Path and brackets in larn (
- Non-Git Directories: Displays
[path] ➜- Path and brackets in larn.
- Prompt arrow in larn.
- Git Repositories: Displays
-
Colorful
lsOutput:- Directories: Bold larn
- 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
larn.zsh-themein your oh my zsh custom themes directory:cp larn.zsh-theme ~/.oh-my-zsh/themes/
- Save the theme file as
-
Set the Theme:
- Edit your
~/.zshrcand set the theme:ZSH_THEME="larn" - 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 -lahto 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 $TERMshould outputxterm-256coloror 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 larn,%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
PROMPTstring inset_promptto change symbols or layout. - Example: Replace
➜with another symbol like→or$.
- Adjust the
-
Extend Git Status:
- Modify
parse_git_statusto 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="larn"is set in~/.zshrc. - Verify Git is installed and working (
git --version). - Check if
is_git_repoworks: Rungit rev-parse --is-inside-work-treein 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
LSCOLORSorLS_COLORSsyntax.
- 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 Larn ZSH Theme! 🚀
