2011-11-14

vim读取临时文件出错

在Windows 7 enterprise (64bit)下使用 gvim 7.3 (64bit),安装了taglist插件,把ctags 5.8放到了路径里,每次在编辑窗口中用 :Tlist 打开列表窗口时总会出现错误提示:
Error detected while processing function 14_Tlist_Window_Toogle..14_Tlist_Window_Open..14_Tlist_Window_Refresh..14_Tlist_Window_Refresh_File..14_Tlist_Process_File:
line 83
E484: Can't open file C:\tmp\VIo24EF.tmp

在windwos下定义了TMP变量为C:\tmp,猜想问题应该出在这个临时文件没有正确生产,导致无法读取。使用 :help E484查看帮助,得到解释:

                            *E484* *E485*  >
  Can't open file {filename}
  Can't read file {filename}

Vim cannot read a temporary file.
查看vim手册,得到解释:

Can't open file C:\TEMP\VIoD243.TMP

On MS-Windows, this message appears when the output of an external command was to be read, but the command didn't run successfully.  This can be caused by many things.  Check the 'shell', 'shellquote', 'shellxquote', 'shellslash' and related options.  It might also be that the external command was not found, there is no different error message for that.
ctags 确认是在路径里,所以只能是调用外部命令没有成功执行。查看shell设置(set shell?)得到:
shell=C:\Windows\system32\cmd.exe;C:\users\dingjun.jia\documents\programme\SysinternalsSuite
不知道是自己不小心把环境变量ComSpec定义错了,还是安装SysinternalsSuite套件时,这个变量被修改了。换用了gvim 32bit版本,修正shell设置后,不在出现错误。

没有评论:

发表评论