日期:2014-05-16  浏览次数:20670 次

linux(debian)下的vim diff时 报错E97解决

1:在用vim比对两个文件时,发现报错了.我用的debian stable,vim是aptitude 过来的vim7.2



2:于是跟踪下diff

root@host:/usr/share/vim/vim72# type diff
diff is /usr/bin/diff
root@host:/usr/share/vim/vim72# type vimdiff
vimdiff is /usr/bin/vimdiff
root@host:/usr/share/vim/vim72# ll /usr/bin/vimdiff
lrwxrwxrwx 1 root root 25 [2012-08-06  3:27] /usr/bin/vimdiff -> /etc/alternatives/vimdiff*
root@host:/usr/share/vim/vim72# ll /etc/alternatives/vimdiff 
lrwxrwxrwx 1 root root 16 [2012-08-06  3:27] /etc/alternatives/vimdiff -> /usr/bin/vim.gtk*
root@host:/usr/share/vim/vim72# 

3:执行下

随便建2个文件类似的内容.有细小区别的.

#echo '111 222 333'>1.txt
#echo '111 222 333'>>1.txt
#echo '111 222 333 444'>>1.txt
#cp 1.txt 2.txt
#echo '111 222 333 44455'>>2.txt
#diff 1.txt 2.txt 

正常diff

#vimdiff 1.txt 2.txt 报错

/bin/bash: /usr/share/vim/vim72diff No Such file or directory

这里就简单了

#ln -s /usr/bin/diff /usr/share/vim/vim72diff
要是编译的7.3的.类似换成vim73diff就行了.路径看你编译的位置

4:diff成功(我改了1.txt的第二行内容)