When I work with the terminal and use
sudo to execute a command with the root user's permissions, is it possible to apply the configuration of my "non-root user" (from which I am invoking
sudo) stored in this user's home directory?
For instance, consider that (being logged on as a non-root user) I would like to edit the configuration file
vim and that my vim configuration file is located at
/home/myuser/.vimrc. Firing up the command line and typing
sudo vim /etc/some_file, I would want "my" beautiful and well-configured
vim to show up. But what I get is an ugly
vim with the default configuration, no plugins etc.
Can I make
sudo use my user's configuration files instead of the root user's files located at /root?