3 ms·
`sudo vim` will not load your user's vimrc, sudoedit will
by josepmdc 5y ago
`sudo vim` will not load your user's vimrc, sudoedit will
- masklinn 5y agoIt will also run your entire editor as root, which may not be something you want.
- dotancohen 5y agoI actually would prefer the editor binary to run as root, rather than have my VIM config available. Any malware that could replace my system VIM would already have access to do whatever it wants to anyway. But malware to alter my own VIM configuration has a much lower barrier to entry.
- dotancohen 5y agoWhich is arguable an attack vector. Depending on how careless the user is, there is far more likely a chance that malicious code is found in .vimrc than is found in the VIM executable.
- fragmede 5y agosudoedit runs your editor as you, not root, so unless I'm misunderstanding you, no such attack surface exists.
- masklinn 5y agoThey’re probably referring to the attack surfaces of the extensions you have loaded in your normal configuration, as opposed to the probably empty environment of root.