This method of unlock bootloader, rooting, install recovery mode in nexus4 is very easy.
1. Select the correct device and build.
2. Configure your drivers if you haven’t already using the driver guide.
3. If you need to, backup your important data.
4. Unlock your device
5. Root your device
Thanks to WugFresh