In Fish when you start typing, autocompletion automatically shows the first autocompleted guess on the line itself.
In zsh you have to hit tab, and it shows the autocompletion below. Is there anyway to make zsh behave more like fish in this regard?
(I am using Oh My Zsh…)
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
I have implemented a zsh-autosuggestions plugin.
It should integrate nicely with zsh-history-substring-search and zsh-syntax-highlighting which are features ported from fish.
Method 2
Try:
autoload predict-on predict-on
See:
info zsh --index-search=predict-on
for details.
Method 3
Follow the steps here to get other features as well:
https://github.com/abhigenie92/zsh_to_fish
- Install oh-my-zsh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
- Clone necessary plugins.
git clone git://github.com/zsh-users/zsh-autosuggestions $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
- Add plugins to
~/.zshrcas
plugins = ( [plugins...] zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting)
Note: make sure zsh-syntax-highlighting is the last one in the above list.
- Fix background theme issues (Not necessary depends on your theme.)
Add the following line to your~/.zshrc.
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=white'
- Restart zsh
source ~/.zshrc
If you like the answer, please consider starring the github repo.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0