Vim帮助说明以下命令会做的魔法:
set diffopt+=iwhite
但不幸的是,此命令只添加-b到diff工具命令行,并且只会忽略结尾的空格。 diff的正确命令行键应为-w,以忽略所有空格更改。但我找不到如何直接从Vim修改diff命令行。当然我可以编译一个自定义diff,或者用diff.sh替换diff,但是看起来有点丑陋:(。
从vim docs的相关部分:
iwhite
Ignore changes in amount of white space. Adds
the “-b” flag to the “diff” command if
‘diffexpr’ is empty. Check the documentation
of the “diff” command for what this does
exactly. It should ignore adding trailing
white space,but not leading white space.
还要注意,您可以通过设置diffexpr提供一个自定义diff命令行。参见关于vimdiff man page的讨论,特别是:
The ‘diffexpr’ option can be set to use something else than the standard
“diff” program to compare two files and find the differences.When ‘diffexpr’ is empty,Vim uses this command to find the differences
between file1 and file2:06000
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。