This one is a widely known feature of vim, as it should be for any other editor
out there. Here’s a brief example on how to set your tab spacing settings
depending on the filetype in vim. Add the following to your vimrc
:
(As seen on stack overflow)
To find out the filetype of the current file in vim, type:
:set filetype
Settings will take effect when the file is loaded, so you may need to source
your vimrc (:so ~/.vimrc
) and then :e
your file again.