vimrc are you talking about? I don't use/know
vim, but in many cases
rc files have two kinds of "incarnation": a system-wide
/etc that dictates the system defaults for the application and user-wide
rc-files under the user homedirs, where users set their own settings, that override the defaults from the system-wide configuration file.
Meanwhile, there is
sudo, that runs a program as another user (usually
root, maybe, like
su, it allows you to impersonate users other than
As you're running
sudo, my guess is that you're expecting
~/.vimrc to be something that it isn't. Either that, or you don't understand what is
sudo doing when you invoke it.
If it really is
~/.vimrc, then it's not "not working", it's actually working quite well, the issue is that there's probably no
~root/.vimrc, or it exists with different settings than these you were expecting.