Where to put custom filetype plugins?
Filetype plugins for
foo filetype are sourced in that order:
$HOME/.vim/ftplugin/foo.vim. Be careful with what you put in that file as it may be overridden by
$VIMRUNTIME/ftplugin/foo.vim -- under windows, it'll be instead
$VIMRUNTIME/ftplugin/foo.vim. Like everything under
$VIMRUNTIME, this file should not be changed.
$HOME/.vim/after/ftplugin/foo.vim. This file comes last so it's the ideal place for your filetype-specific settings.