Usage of ‘after/ftplugin’ directory for filetype-specific configuration

neovim
reddit
Author

Evgeni Chasnovski

Published

September 2, 2022

Originally posted on Reddit

Do you create any configuration that is specific to a certain file type (like setting local options or buffer-local variables, creating local mappings, running some function, etc.)?

This is meant as a Friday post to make more people aware of ‘after/ftplugin’ directory, because I find this approach really more structured than using autocommands. For reference, here is how I do it.

Some further reading: