Vim - nobomb - 删除文件的BOM
*'bomb'* *'nobomb'*
'bomb' boolean (default off)
local to buffer
{not in Vi}
{only available when compiled with the |+multi_byte|
feature}
When writing a file and the following conditions are met, a BOM (Byte
Order Mark) is prepended to the file:
- this option is on
- the 'binary' option is off
- 'fileencoding' is "utf-8", "ucs-2", "ucs-4" or one of the little/big
endian variants.
Some applications use the BOM to recognize the encoding of the file.
Often used for UCS-2 files on MS-Windows. For other applications it
causes trouble, for example: "cat file1 file2" makes the BOM of file2
appear halfway the resulting file.
When Vim reads a file and 'fileencodings' starts with "ucs-bom", a
check for the presence of the BOM is done and 'bomb' set accordingly.
Unless 'binary' is set, it is removed from the first line, so that you
don't see it when editing. When you don't change the options, the BOM
will be restored when writing the file.
[Vim - nobomb - 文档]
http://vimdoc.sourceforge.net/htmldoc/options.html#%27nobomb%27[vi - 官方网站]
http://www.vim.org/[vi - 下载地址]
当前版本7.2, http://www.vim.org/download.php[vi - 相关论坛]
http://vim.board.newsmth.net/[vi - 相关关键词]
vi[vi - 常用操作]
vi中使用dd命令删除一行, http://vimdoc.sourceforge.net/htmldoc/change.html#dd
编辑cygwin的Bash脚本, set fileformat=unix
删除文件的BOM, http://vimdoc.sourceforge.net/htmldoc/options.html#%27nobomb%27