How do I use `sudo -e` together with gvim?

So when one edits a file owned by root it is recommended to use sudo -e. This will open a copy of the file in your favorite $EDITOR. Using this together with vim works like a charm.

However, when I want to use the graphical variant, i.e. gvim, it will open an empty file, and the sudo command returns directly, stating that nothing was changed.

Is there a way to make this work?

6 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like