🔍 See Original Answer on Ask Ubuntu 🔗
Is Vim safe to use in combination with sudo?
November 7, 2018
November 24, 2022
Copy to clipboard: false
The link is very old (2013). It recommends using
gksu for graphical applications but both of those are becoming obsolete. Later on the accepted answer also suggests
sudo -H though.
The general consensus in the Ask Ubuntu community recently is to use:
sudo -H gedit /path/to/filename
The only problem remains that
sudo doesn’t have a profile for tab settings, extensions, word wrap, font name, font size, etc. You can inherit these from your user profile though with a wrapper script like this: How can I sync my root gedit with my user gedit's preferences?