I fall under the first category: sudo vim /var/www/html/some_file is a bad idea; it allows shell escapes that aren't logged. Instead, use sudoedit /var/www/html/some_file; that has the same effect.
"Running sudo vim won't change the $HOME directory, so you will be running Vim with root permissions, but $HOME is still pointing to your normal user.
If this is the first time you are running Vim, it may happen that ~/.viminfo file is created inside your normal user directory, but with root permissions."
"IF THIS IS YOUR OWN COMPUTER... I see no reason why you can't use 'sudo vim', other than the edge case that Denilson noted - that it might create your ~/.viminfo owned by root.
If not - if a systems administrator is restricting what you can and can't do - per ""man sudo"": ""on most systems it is possible to prevent shell escapes with sudo's noexec functionality. See the sudoers(5) manual for details.""
So in this case, if your sysadmin is concerned about the potential of you running subshells as root from within vim, they can use the noexec capability. But... back to the initial case - if this is YOUR computer, I think you're pretty darn safe running 'sudo vim'."