vim and sudo vim using different settings on openSUSE
===

I want vim to save folded code after I've closed the file. I've added the following code to both /etc/vimrc and ~/.vimrc:

    au BufWinLeave ?* mkview
    au BufWinEnter ?* silent loadview

When I open a file as a regular user (vim file) it works as expected. If I instead open with sudo vim file it doesn't save folded code.

I know /etc/vimrc is being read. My theme is set at the bottom of that file and is working fine. I ran into a similar problem last week installing the vim surround plugin. When that was installed in ~/.vim it only applied to vim file. To get it working with sudo I had to install it separately in /usr/share/vim/current. What could be causing this?