Using vim with something like sudo vim /path/to/file has historically made my head hurt. All my magic from vim-bootstrap hasn't worked. I knew why, I just didn't care enough to fix it. Until I did.
Fix that with this simple flag:
sudo -E vim /path/to/some/file
Voilà!
From man sudo: