How to set different tab space widths for different code files (which can be simply judged by the suffix name) in the .vimrc file? For example, the tabs of .rb files are indented by two spaces at a time, the tabs of .c files are indented by three spaces, and the tabs of .cs files are indented by four spaces, similar to this. PS: It only needs to be used on linux and osx. Thanks in advance to all those who provided answers.
Just set it according to the file type, as follows.