It’s ridiculously simple:
- Connect USB cable
sudo apt-get install hplip-gui
- Select network, insert password if necessary
- Disconnect USB cable
At this point you can connect to your printer via wireless. You may need to set it up separately using
hp-setup or System → Administration → Printing. In the latter you can rename or remove the USB connection to avoid confusion with the wireless configuration.