Tuesday, November 19, 2013

File type detection.

Hi All,

 

I want to use my own filetype.vim script to load a filetype plugin.

 

When VIM start uses his own filetype.vim from installation directory and base on the file content
incorrect file type is set. As I found in documentation (43.2 Adding a filetype) another filetype.vim
will not set a new file type when it is already set for the file.

 

Order which filetype.vim file is first I am checking with :scriptnames command.

 

As I understand load order is control with runtimepath option.

I changed &rtp to load my filetype.vim script before  VIM’s filetype.vim.

It works on Windows but not on Redhat 5 (both have VIM 7.4).

 

When I compare runtimepath option and scriptnames I see VIM load scripts not in order of paths from &rtp.

Is it normal? Does not &rtp  control order how the scripts are  loaded?

 

How can I force VIM to load my filetype.vim as first?

 

Thanks & Regards,

Bartosz

No comments: