Skip to content

Instantly share code, notes, and snippets.

@elliotwutingfeng
Last active March 9, 2024 17:21
Show Gist options
  • Save elliotwutingfeng/32ae7287187f7d3ef701bed4b331d135 to your computer and use it in GitHub Desktop.
Save elliotwutingfeng/32ae7287187f7d3ef701bed4b331d135 to your computer and use it in GitHub Desktop.
Setting up oh-my-zsh

oh-my-zsh

Install oh-my-zsh and some useful plugins

# Install oh-my-zsh
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

# zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

# zsh-Z
git clone https://github.com/agkozak/zsh-z $ZSH_CUSTOM/plugins/zsh-z

# fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
yes | ~/.fzf/install
pamac install fd

# autoupdate-oh-my-zsh-plugins
git clone https://github.com/TamCore/autoupdate-oh-my-zsh-plugins $ZSH_CUSTOM/plugins/autoupdate

chsh -s $(which zsh)

Additional step for fzf: Add the following lines at the end of .zshrc

export FZF_DEFAULT_COMMAND='fdfind --type f'
export FZF_DEFAULT_OPTS="--layout=reverse --inline-info --height=80%"

In .zshrc, set

plugins=(  
    fzf 
    git 
    history-substring-search 
    colored-man-pages 
    zsh-autosuggestions 
    zsh-syntax-highlighting 
    zsh-z 
    autoupdate 
)

zstyle ':omz:update' mode auto # This line exists in .zshrc as a default comment.

In .zshrc, set the following

export DISABLE_UPDATE_PROMPT="true"
export UPDATE_ZSH_DAYS=1
export ZSH_CUSTOM_AUTOUPDATE_NUM_WORKERS=8

Use upgrade_oh_my_zsh_all to update both oh-my-zsh and custom plugins.

Source: https://medium.com/tech-notes-and-geek-stuff/install-zsh-on-arch-linux-manjaro-and-make-it-your-default-shell-b0098b756a7a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment