vi ~/.ssh/config :set syn? >syntax=conf
When I do:
Then the syntax highlighting is as it should be.
Why isn't the filetype automatically identified? And how can it be set automatically?
Assuming what you've done is created a symlink ‘~/.ssh’ to a folder named ‘ssh’ somewhere else on your system, for example ~/git/ssh, you have 2 options:
inside ‘~/.vim/ftdetect/ssh.vim’ put the following line:
Make sure that the folder which the symlink resolves to is called ‘.ssh’
The culprit file ⇒ /usr/share/vim/vim73/filetype.vim:
Adding this line to your
should be enough for Vim to recognize the filetype and apply the correct syntax.