As we all know the names of the packages in the repository are not always simple, and if the spelling is not correct maybe you can lost a lot of time thought the problem is other. To overpass this problem you can allow the pacman autocompletion (as indicate in a forum here).
Firstable you have to download and install the package bash-completion:
then you need to eneble it in ~/.bashrc just adding the following lines to the file (1):
Now you can simple use the tab to autocomplete package’s names using pacman (or yaourt).
If you need autocomplete for a different shell you can search it on the ArchLinux wiki.
####################################################
(1) As adviced by Andrei is possible to write this script in a different way, to support others shells and extra operators, is the follow:
actually the right code is:
if [[ -f /etc/bash_completion ]]; then
/etc/bash_completion
fi
As you can find on Bash Reference Manual
[[]]
is a new version of[]
that allow to use more constructors and is portable on others shell.The script of the article is written only for bash shell and with supported conditional constructor by
[]
.Thanks for your comment, we will add your solution, because is a different way (better in general) to write it.