Skip to content

Instantly share code, notes, and snippets.

@jackos
Last active June 19, 2024 22:50
Show Gist options
  • Save jackos/7da72aac8b4faf75312107f6e364aa11 to your computer and use it in GitHub Desktop.
Save jackos/7da72aac8b4faf75312107f6e364aa11 to your computer and use it in GitHub Desktop.
Make zsh behave like fish with even better completions

Make sure to backup your ~/.zshrc:

cp ~/.zshrc ~/.zshrc-backup

Install Oh My Zsh with:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Clone the plugins:

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

Follow the steps here for great command completions: https://carapace-sh.github.io/carapace-bin/install.html

Replace all the junk in ~/.zshrc with:

export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="eastwood"

plugins=(
    zsh-autosuggestions 
    zsh-history-substring-search 
    zsh-syntax-highlighting
    )

source $ZSH/oh-my-zsh.sh
source <(carapace _carapace)

Add back anything you need from ~/.zshrc-backup to ~/.zshrc

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