`setglobal bomb` seems to doesn't work properly.[]
See here: https://stackoverflow.com/questions/54469975/save-file-with-bom-preserved
(The above comment was added on 2 February 2019 at 14:54 CET by anonymous user 178.67.234.54).
- So? Why do you think it is commented-out? Setting 'bomb' on (which only has an effect if the 'fileencoding' is a Unicode one) is OK for some filetypes, e.g. HTML or CSS; for others, including any executable scripts whose first line is the interpreter program preceded by the #! character pair, it will cause failure because the loader looks only at the first two characters of the file to see if they are that, and the presence of a BOM shoves them over so they aren't the first two any more.
- Similarly most C compilers expect the source to be ASCII, except that string literals (but not the first bytes of a source file) can be anything other than a string literal terminator (i.e. the appropriate single or double quotation mark) or (IIUC) a null byte.
- I recommend not to set 'bomb' on as a Vim-level default; setting it with :setlocal for the filetypes which recognize it, in a filetype-plugin (e.g. for HTML in ~/.vim/after/ftplugin/html.vim on Unix-like OSes; replace .../vim/... by .../vimfiles/... on Windows) is probably OK. Tonymec (talk) 01:56, February 3, 2019 (UTC)