prezto在更新后无法加载,在没有明显原因的情况下给出了解析错误

时间:2014-02-22 16:11:59

标签: zsh prezto

前段时间我从oh-my-zsh改为prezto。这是一个可怕的安装过程,但在它工作后我很高兴。终端窗口的启动时间发生了巨大变化。我很高兴这个古老版本的prezto,但只是好奇心决定更新。

我按照github页面上的建议做了。

git pull && git submodule update --init --recursive

现在我看到这三个错误,然后我启动终端。

/Users/lun/.zshenv:10: parse error near `fi'
/Users/lun/.zprofile:74: parse error near `fi'
.zprezto/init.zsh:50: parse error near `elif' 

在出现更多错误之前,我已将它们清理干净了。对于某些角色来说,它看起来像是错误的编码,但对于这些角色则不然。

https://gist.github.com/skatkov/9157258

因为prezto无法加载。

也许我错过了什么?

1 个答案:

答案 0 :(得分:0)

我修复了它,感谢freenode上的#zsh频道。

问题出在我的git配置中,它迫使Windows行结束。 (linux使用LF(^ J)表示行结尾,windows CRLF(^ M ^ J))

如果'git config --global core.autocrlf'返回true,你应该:

  1. 备份你的zrpezto配置(我刚刚提交所有更改并推送到我自己的github repo)
  2. 设置'git config --global core.autocrlf false'
  3. 删除prezto dir'rm -r~ / .zprezto'
  4. 结帐prezto并应用您的配置。
相关问题