We already know that Nexus devices are easy to unlock and root, but the process is still a bit different each time. Thus, XDA member HQRaja posted a handy guide on exactly how to root the Nexus 4.
There are two different ways of rooting the device - using either ADB with an insecure boot image, or directly through ClockworkMod Recovery. While both methods are posted in the source thread at XDA, the CWM method is undoubtedly easier and will probably feel more familiar to most. Ergo, we're going to focus on doing it that way.
First off, this requires working fastboot and adb.