How do you apply settings only for specific filetypes?
Answer
autocmd FileType python setlocal tabstop=4 expandtab
Explanation
Use autocmd FileType to set buffer-local options for specific filetypes. Use setlocal instead of set to avoid affecting other buffers.