Sudar
Sudar

Reputation: 20000

Correct filename for new file types inside ftdetect folder for vim

I am creating a new filetype for arduino files in vim.

I looked into the ftdetect documentation and it is specified that a new file with the following content inside the .vim/ftdetect/ folder should be created

au BufRead,BufNewFile *.mine        set filetype=mine

In the above example both the file extension and filetype are same and the file is created with the name mine.vim

But for arduino the file extension (.ino and pde) is different from the filetype (arduino)

My question is what should be the filename in this case. Should it be ino or arduino?

Upvotes: 1

Views: 436

Answers (1)

Nikita Kouevda
Nikita Kouevda

Reputation: 5746

The filename should be the same as the filetype, i.e. arduino.vim in this case. In order to recognize both file extensions, list them as follows:

au BufRead,BufNewFile *.ino,*.pde set filetype=arduino

Upvotes: 7

Related Questions