Thomas
Thomas

Reputation: 6196

Trying to add filetype to autocmd produces error

This is what I'm trying to do, toggle a plugin based on file type

au FileType lisp,clojure,scheme VimEnter * RainbowParenthesesToggle

produces error:

Error detected while processing FileType Auto commands for "clojure":                                                                                                                  
E492: Not an editor command: VimEnter * RainbowParenthesesToggle                                                                                                                       
E492: Not an editor command: VimEnter * RainbowParenthesesToggle                                                                                                                       
E492: Not an editor command: VimEnter * RainbowParenthesesToggle                                                                                                                       
E492: Not an editor command: VimEnter * RainbowParenthesesToggle   

Where is the error here?

Upvotes: 1

Views: 213

Answers (1)

filbranden
filbranden

Reputation: 8908

Drop the VimEnter *.

Each autocmd should have a single event and pattern, but you specified two of each in yours. The FileType event makes sense for this command, so keep that one.

This should work:

au FileType lisp,clojure,scheme RainbowParenthesesToggle

Upvotes: 1

Related Questions