Oh My Zsh is a popular open-source framework for managing Zsh configurations. It comes with a variety of themes, plugins, and features to enhance the Zsh shell experience. Here’s a Oh My Zsh cheat sheet:
Installation
Install Oh My Zsh:
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Switch to Zsh:
chsh -s $(which zsh)
Themes
Change Theme: Open your ~/.zshrc
file and set the ZSH_THEME
variable to the desired theme.
ZSH_THEME="agnoster"
List Installed Themes:
ls ~/.oh-my-zsh/themes
Plugins
Enable/Disable Plugins: Open your ~/.zshrc
file and add or remove plugin names in the plugins
array.
plugins=(git vscode)
List Available Plugins:
ls ~/.oh-my-zsh/plugins
Aliases
Define Aliases: Open your ~/.zshrc
file and add alias definitions.
alias ll="ls -l"
List Defined Aliases:
alias
Navigation
Go to Home Directory:
cd
Go to Previous Directory:
cd -
Autocomplete
Autocomplete Commands: Start typing a command and press Tab
for autocomplete suggestions.
Autocomplete Files/Directories: Start typing a file/directory name and press Tab
for suggestions.
History
View Command History:
history
Search Command History: Press Ctrl + r
and start typing to search command history.
Oh My Zsh Commands
Update Oh My Zsh:
omz update
Check for Updates:
omz outdated
Customization
Customize Prompt: Customize the prompt by modifying the PROMPT
variable in the ~/.zshrc
file.
Customize Colors: Customize colors by modifying the ZSH_THEME
and ZSH_THEME_COLORS
variables in the ~/.zshrc
file.
Troubleshooting
Reload Zsh Configuration:
source ~/.zshrc
These commands should help you navigate and customize your Oh My Zsh shell. Remember to review the official Oh My Zsh documentation for more details and advanced customization options.