curl -L https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | bashFrom the zsh shell:
# Install syntax highlight plugin
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# Install autosuggestions plugin
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestionsOptionally, delete the .git directory in both plugins to make room.
Ensure the font supports the special characters, e.g. Fira Mono for Powerline. The Powerline fonts can be downloaded from https://github.com/powerline/fonts, and installed by double-clicking on the font file.
Enable the theme by editing .zshrc and locating the line starting with ZSH_THEME=...:
ZSH_THEME="agnoster"In .zshrc, locate the line starting with plugins=( and add the installed plugins:
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
)Slightly change the code of Agnoster theme segments. In file ~/.oh-my-zsh/themes/agnoster.zsh-theme, update the prompt_context and prompt_dir functions:
# Context: user@hostname (who am I and where am I)
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
# prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m"
prompt_segment cyan black "%n@%m"
fi
}
# ...
# Dir: current working directory
prompt_dir() {
# prompt_segment blue $CURRENT_FG '%~'
prompt_segment blue white '%~' # Or '%2d' for the last 2 directories
}
Check out the z tool to quickly jump across directories.
Download it and source it from ~/.zshrc.
Check its repository at: https://github.com/lcrespom/oh-my-zsh-history-popup