1

I have a file that's being recognized as jasmine.coffee in VIM, but &filetype=='coffee' evaluates to false.

Is there a way to do a partial filetype match in Vimscript

Xavier T.
  • 40,509
  • 10
  • 68
  • 97
Christian Schlensker
  • 21,708
  • 19
  • 73
  • 121

1 Answers1

2

Use the =~ pattern matching operator instead, which will treat the right side as a regular expression to test against.

&filetype =~ 'coffee' 

This is mentioned in the Conditionals section of the Vimscript documentation.

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390