I'm trying to get into the habit of editing root-owned files with sudoedit, instead of sudo vim. This has a few advantages, one of which is that it uses my user's ~/.vimrc.
Is there an equivalent, instead of using sudo vimdiff?
What I've tried
- Instead of using
vimdiffdirectly, one can open two files in vertical splits, then run:diffthisin both. However, if I open up one file withsudoedit, then I'd have to open the second file directly, instead ofsudoeditautomatically creating a copy of this file in/var/tmp. - One can also open files directly in splits using
vim -O file1 file2. However, unsurprisingly,sudoedit -Ofails.