Vim Sets tab Width for Editing in Different File Formats

  question, vim

When vim is used to edit codes, the default tab is 8 characters wide. How to write a configuration file can reach 4 characters wide when editing html files, while other files still keep 8 characters wide?

You can try using the automatic command au FileType html set tabstop=4.