To install a command-line suggestion tool in your Linux terminal, you can use zsh-autosuggestions with the Zsh shell, or fzf for fuzzy finding in your history.
1. Using zsh-autosuggestions (with Zsh shell):
Install Zsh and zsh-autosuggestions.
Code
sudo apt update sudo apt install zsh zsh-autosuggestions
(Replace apt with your distribution’s package manager if not Debian/Ubuntu-based, e.g., dnf for Fedora, pacman for Arch.)
Set Zsh as your default shell (optional, but recommended for full integration):
Code
chsh -s $(which zsh)
You will need to log out and log back in for this change to take effect.
Configure zsh-autosuggestions in your .zshrc file:
Open ~/.zshrc in a text editor (e.g., nano ~/.zshrc or vim ~/.zshrc).
Add the following line to the end of the file:
Code
source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
Save and close the file. apply the changes.
Code
source ~/.zshrc
Now, as you type commands in Zsh, you will see command suggestions based on your history, which you can accept by pressing the right-arrow key or End.