When I want to vimdiff
root files, I use the following alias, as per this suggestion.
alias sudovimdiff='SUDO_EDITOR=vimdiff sudoedit'
I can then use the following command.
$ sudovimdiff /root/a /root/b
However, if one of the files is writable by my user, the command fails.
$ sudovimdiff /root/a /tmp/b
sudoedit: /tmp/b: editing files in a writable directory is not permitted
Is there a way to vimdiff one root and one non-root file, using my user's environment settings (i.e. sudoedit
)?
root
? – Wildcard Jan 10 '18 at 04:41