1

I have put new javascript syntax and indent files in my 'bundle' directory (I use Pathogen). I noticed that VIM loads both my new files as well as the standard files, in particular it loads the standard files after and I fear it may be overwriting the custom ones.

The VIM docs says it should not load the standard files if it found custom one first so I am not sure why this is happening.

This is what I see with the :scriptnames command, you can see the standard files (line 32, 35) after the customer ones (line 31, 34)

31: /usr/share/vim/vimfiles/bundle/vim-javascript/syntax/javascript.vim                                                                                                                                            
32: /usr/share/vim/vim73/syntax/javascript.vim                                                                                                                                                                     
33: /usr/share/vim/vim73/ftplugin/javascript.vim                                                                                                                                                                   
34: /usr/share/vim/vimfiles/bundle/vim-javascript/indent/javascript.vim                                                                                                                                            
35: /usr/share/vim/vim73/indent/javascript.vim 
4

1 回答 1

3

系统默认和您的自定义语法文件都出现在:scriptnames输出中很好。Vim 将 source 中找到的所有文件'runtimepath',但规范的包含保护

if exists("b:current_syntax")

将导致在第一个之后运行的所有脚本在检查后立即中止。

于 2012-11-06T15:11:47.807 回答