I've just migrated to Zsh from Bash, but I have a bit of a problem in it. In bash on an Ubuntu system, when I type the name of a command which does not exist, Bash searches the apt database for a matching command name and prints out the package names that provide that command. It's a really useful feature, so I was wondering if something like that could be implemented in Zsh using a script or something?
Here's an example:
$>xmms2
The program 'xmms2' is currently not installed. You can install it by typing:
sudo apt-get install xmms2-client-cli
Or if the command is not an exact match:
$>xmms
No command 'xmms' found, did you mean:
Command 'lmms' from package 'lmms' (universe)
Command 'xmms2' from package 'xmms2-client-cli' (universe)
Command 'xmds' from package 'xmds' (universe)
Command 'xdms' from package 'xdms' (universe)