In vim, how can I set the file type not only according to the extension, but according to the #! line at the beginning? For instance, I would like vim to recognize files as coffee-script files when they start with #!/usr/bin/env coffee
|
feedback
|
|
Vim usually properly detects filetypes when the hash-bang does not use the "env" utility, and it has code to try to internally translate The good news is that you can add to Vim's detection without having to modify the distribution files. You simply add your own detection logic to | |||
|
feedback
|