I want to set some commands for specific filetypes. For example an abbreviation:
:iabbr Sb SameBatch
The files have extension like .data
, .pro
. Their grammar, syntax-highlighting are defined in the framework. I am unaware of those things. Those files contain variables and their values for Perl scripts.
I tried
:au FileType data iabbr di ditto
But it doesn't work.
I thought that the extension is the file type of a file. Is it wrong and how to get it worked?
au BufNewFile,BufRead *.data set filetype=data
. See also this link:set filetype
. That will tell you what Vim thinks is the filetype.