vimtricks.wiki Concise Vim tricks, one at a time.

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.

Next

How do I visually select a double-quoted string including the quotes themselves?