Is there a way to ask Vim to change the indentation style based on the style already used in the current file?
:au BufEnter *.js :set shiftwidth=2. This works for all projects,
*.*is just a pattern. You can use filename or path as well. Or, you can use similar auto command like what I gave, for each file. You can instruct the auto command to take the tabwidth of current file and put it for path of this file. Its pretty easy.