我将Pathogen插件用于gvim。在配置时,我在vimrc文件中设置了以下内容:
call pathogen#infect()
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
filetype on "force reloading *after* pathogen loaded现在,我按照Martin的Youtube上的这个教程设置Vim,使其对Python编码有用,他建议如下:
filetype off
filetype plugin indent on
syntax on 所以目前我有filetype on的病原体,但他建议filetype off。这一行代码是做什么的,我应该如何配置vimrc,以便病原体和Python都是快乐的?
发布于 2013-07-13 14:56:04
call pathogen#runtime_append_all_bundles()根本不需要:函数被废弃了,而且无论如何都没有用。
如果你真的需要安全,这就是你应该在~/.vimrc顶部拥有的东西。
" turn filetype detection off and, even if it's not strictly
" necessary, disable loading of indent scripts and filetype plugins
filetype off
filetype plugin indent off
" pathogen runntime injection and help indexing
call pathogen#infect()
call pathogen#helptags()
" turn filetype detection, indent scripts and filetype plugins on
" and syntax highlighting too
filetype plugin indent on
syntax on然而,我已经有很长一段时间了,没有任何明显的问题:
call pathogen#infect()
call pathogen#helptags()
filetype plugin indent on
syntax on发布于 2013-07-13 13:09:42
:filetype off在紧接:filetype [plugin indent] on时是多余的(当它再次打开文件类型检测时,如:help filetype-plugin-on所述);不要盲目地信任因特网上的任意资源:-)
您通常需要文件类型检测(以便可以加载相应的语法,用于突出显示(使用:syntax on))、特定于文件类型的设置( plugin部分)和缩进规则(indent)。
病原体的唯一缺陷是,这应该发生在病原体初始化之后,但是你已经做对了。
发布于 2013-07-13 12:57:01
filetype on支持文件类型检测。将filetype plugin或filetype indent设置为on将打开文件类型检测,如果不是这样的话。见:help filetype。
https://stackoverflow.com/questions/17630393
复制相似问题