我需要在数千个文件上执行vim命令,而不会受到交互模式缓慢的影响。我想:在没有交互模式的情况下执行vim命令
find ... | xargs vim '+set fileencoding=utf-8 | x'
和
for file in ... ; do vim '+set fileencoding=utf-8 | x' $file done
但它太慢了,我必须警告
Vim : Warning : Output is not to a terminal
是无法避免的vim交互模式?
PS:我,否则可以使用iconv,但它会导致错误与文件> 32 KO
iconv --from-code=ISO-8859-1 --to-code=UTF-8 $file -o $file
“但它会导致文件> 32 KO的错误” - 是应该阅读“kb”而不是“ko”? – 2011-02-02 18:44:30