oh my zsh tips - Murray-LIANG/forgetful GitHub Wiki
Oh My Zsh Tips
Installation
sudo apt install -y zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Customized Configuration
- In
~/.zshrc
, set ZSH_THEME
to robbyrussell
.
- Modify
plugins
to:
plugins=(
git
zsh-autosuggestions
)
- Append below lines to
~/.zshrc
.
export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'
export GOPATH=~/git/go
export PATH=$PATH:$GOPATH/bin:/snap/bin
# Jupyter notebook
alias inote='cd /mnt/hgfs/liangr-win10/git/ipython && \
nohup /home/liangr/git/ml/venv/py36/bin/jupyter notebook \
--ip 0.0.0.0 --port 19032 --no-browser \
&> /mnt/hgfs/liangr-win10/git/ipython/notebook.log &'
- Update
~/.oh-my-zsh/themes/robbyrussell.zsh-theme
.
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} %{$fg[cyan]%}%~%{$reset_color%} $(git_prompt_info)'$'\n''$ '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%}) %{$fg[green]%}✔"