3

I've got a computer with windows 7 in which I've recently installed Git (with Vim inside the Git directory). I tried installed pathogen and apparently it is installed correctly since there are no error messages with pathogen in autoload. My _vimrc is located in Users/Username which is $HOME and it the following is relevant to pathogen.

execute pathogen#infect() //_vimrc starts with this line
call pathogen#helptags()
syntax on
filetype plugin indent on

the path to autoload and bundle is: C:/progra~1/git/usr/share/vim/vim74/autoload(and vim74/bundle)

When I clone a plugin (ex. NerdTree) to bundle, the following message appears when I open Vim.

Error detected while processing /usr/share/vim/vim74/bundle/nerdtree/plugin/NERD_tree.vim:
line   16:
E15: Invalid expression: exists("loaded_nerd_tree")^M
line  211:
E171: Missing :endif

I also start a session in vim and use

:help NERD_tree.txt 

but it returns "Sorry, no help for NERD_tree.txt"

Does anybody know what is causing the problem and has the solution?

4

1 回答 1

2

第一的

您的所有配置都应该发生在$HOME/.vim/(插件、颜色方案等)和$HOME/.vimrc(选项、映射等)中。另请注意,从 Vim 7.4 开始,您可以vimrc直接在 inside$HOME/.vim/中,这使得管理您的配置更加容易。

你所做的一切都/usr/share/vim/应该尽快恢复。

第二

但是您的问题是由行尾引起的:克隆过程将作者使用的那些 - lf- 更改为 Windows 上的标准 - crlf。因为 Vim 只接受lf它无法获取你的插件。

原因很可能是core.autocrlf您的 Git 设置中的值。

下面的命令应该会阻止 Git 转换lfcrlfon checkout// clone/ pulletc.:

 git config --global core.autocrlf false
于 2015-09-03T07:36:53.367 回答