diff --git a/zsh/.zshrc b/zsh/.zshrc index d2a886f..753eed3 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -12,6 +12,15 @@ else shared_config=0 fi +# Workaround for HOME directory in sudo nvim (caused by snap) +if [[ "$USER" == "root" ]]; then + if [[ ! -e /home/root ]]; then + ln -s /root/ /home/root + elif [[ ! -e /home/root/.config ]]; then + ln -s /root/.config /home/root/.config + fi +fi + if [[ -f ~/.zsh/.shared_config ]] ; then touch ~/.config/nvim/.shared_config fi