Instead of sudo vim, you can use sudoedit. This is safer — a user can run arbitrary shell commands from vim, so sudo vim can introduce a security risk. sudoedit opens a temporary copy of the file for you to edit with normal vim (with your own vimrc and everything) and then just uses sudo priveledges to replace the file you're editing with the temporary one.
Instead of sudo vim, you can use sudoedit. This is safer — a user can run arbitrary shell commands from vim, so sudo vim can introduce a security risk. sudoedit opens a temporary copy of the file for you to edit with normal vim (with your own vimrc and everything) and then just uses sudo priveledges to replace the file you're editing with the temporary one.