I have tons of files in Python and other languages written as indented by 2 spaces, so I have the following settings in my ~/.vimrc:
However, after I installed Vim 8.0 and python-mode for myself, I keep getting shiftwidth rewritten as 4 when I open Python files. I tried uninstalling python-mode, but it doesn't help.
The reason is here, and there is an issue filed against this behavior.
To avoid modifying tons of files, I added the following line to my ~/.vimrc to turn this feature off.