I have modified my .zshrc and .vimrc to my likings. Both files source other files containing more configuration and plugins (vundle, antibody). Now I would like to use these configurations when I change to the root user as well.Currently my .zshrc looks like this# .zshrc# Sources the files in .shell directoryexport SHELL_CONF_DIR='/home/myUser/.shell'source $SHELL_CONF_DIR/initShell.shinitShell.sh does the following# initShell.sh# Sources further scripts. $SHELL_CONF_DIR/antibody.sh. $SHELL_CONF_DIR/compinstall.sh. $SHELL_CONF_DIR/configuration.sh. $SHELL_CONF_DIR/options.sh. $SHELL_CONF_DIR/aliases.sh. $SHELL_CONF_DIR/variables.sh. $SHELL_CONF_DIR/virtualenv.sh. $SHELL_CONF_DIR/functions.sh. $SHELL_CONF_DIR/keybindings.sh. $SHELL_CONF_DIR/xorg.shI want to manage my .vimrc in a similar fashion.Now the root users .zshrc is just a symlink to my normal users .zshrc. This works pretty well but I think, concerning security, this might not be an ideal solution. So where should I actually put all this configuration and how should I handle it so the root user can use it, too? Or is this actually the wrong approach? I know that I can preserve environment variables with sudo -E but that doesn't work when doing sudo -i.
Sharing zsh and vim configuration with root user
sudo;environment variables;root;bashrc;vimrc