How to Load Neovim init.lua or init.vim in Sudo Mode Linux

I'm a self-taught web developer who likes sharing my knowledge, helping people.
One of the biggest problems that I found when I was starting with Neovim was how to execute it in Sudo mode because my config file was always lost and did not work as I expected, here is the solution
We need to make an alias:
export SUDO_EDITOR="nvim"
alias "sudoedit"='function _sudoedit(){sudo -e "$1";};_sudoedit'
Now, we need to add these lines in the correct profile file: ~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc and make a source for example: source ~/.zshrc
If everything goes well we can use Neovim in sudo mode!!!!!.



![How To Create Admin Panel using Filament [TALL STACK]](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1639173022637%2F4BT9qk5g3.png&w=3840&q=75)

