Mac上的Vimdiff不起作用

时间:2016-08-14 21:38:14

标签: vim

我想让vimdiff在我的mac OX上工作--Darwin 15.6和vim 7.3。当我使用-V选项运行vimdiff时,我看到以下错误:

Calling shell to execute: "diff -a /var/folders/9p/2bnq24nd1qd75xn0sxg172kd6r9fpw/T/vha2EMz/0 /var/folders/9p/2bnq24nd1qd75xn0sxg172kd6r9fpw/T/vha2EMz/1 >/var/folders/9p/2bnq24nd1qd75xn0sxg172kd6r9fpw/T/vha2EMz/2"
Calling shell to execute: "diff /var/folders/9p/2bnq24nd1qd75xn0sxg172kd6r9fpw/T/vha2EMz/0 /var/folders/9p/2bnq24nd1qd75xn0sxg172kd6r9fpw/T/vha2EMz/1 >/var/folders/9p/2bnq24nd1qd75xn0sxg172kd6r9fpw/T/vha2EMz/2"
Error detected while processing function <SNR>6_VimEnter:
line    2:
E810: Cannot read or write temp files
Error detected while processing function <SNR>6_VimEnter:
line    2:
E97: Cannot create diffs
/ var / folders / 9p / 2bnq24nd1qd75xn0sxg172kd6r9fpw / T中的

vha2EMz文件夹不存在。我可以访问/ var / folders并在其中创建目录,因此它不是权限问题。任何人在基于Unix的系统上有这种错误的经验吗?

我根据this检查了我的/ usr / share / vimrc文件,但在那里找不到MyDiff()。这是问题吗?我应该替换/ usr / share / vimrc还是添加MyDiff定义?

1 个答案:

答案 0 :(得分:0)

问题是没有设置$ SHELL变量。 Vim从$ SHELL获得默认值。