Customize oh-my-zsh for auto-completion similar to fish shell

To customize oh-my-zsh for auto-completion similar to fish shell, follow these steps:

  1. Enable zsh-autosuggestions and zsh-syntax-highlighting These two plugins mimic the fish shell’s behavior by providing autosuggestions and syntax highlighting.

Step 1.1: Install Plugins Open your terminal and run:

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

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

Step 1.2: Enable Plugins in ~/.zshrcEdit your .zshrc file:

nano ~/.zshrc

Find the plugins=(...) line, and add the installed plugins:

plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Save the file and reload the configuration:

Advertisements
source ~/.zshrc

2. Install zsh-completions (Optional)

To further enhance completions, you can install the zsh-completions plugin.

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

Add it to your .zshrc plugins list

plugins=(git zsh-autosuggestions zsh-syntax-highlighting zsh-completions)

Reload with:

source ~/.zshrc

Final Touches

Restart your terminal to apply all changes. You should now have autosuggestions and syntax highlighting similar to fish, with custom key bindings for better usability.

This setup provides a fast and interactive ZSH experience, similar to what you get with the fish shell!

Similar post: Master Git: Key Commands Every Developer Must Have in Their Toolkit

Leave a Comment

Scroll to Top