How many times have you edited a file just to find out that you need root credentials to save the changes?
In situations like these, a well known trick comes to your rescue.
# Use the below syntax while saving the file from within VIM. :w !sudo tee % > /dev/null
The internals of the above VIM command has been beautifully explained by Nathan Long at http://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work.