Skip to content

Instantly share code, notes, and snippets.

@nixel2007
Created January 22, 2016 07:33
Show Gist options
  • Save nixel2007/ed991d8001fbb59689fb to your computer and use it in GitHub Desktop.
Save nixel2007/ed991d8001fbb59689fb to your computer and use it in GitHub Desktop.
save as utf-8-bom in atom
atom.workspace.observeTextEditors (editor) ->
editor.onDidSave ->
if editor.getPath().slice(-3) is '.os'
if editor.getEncoding() is 'utf8' and editor.getText().charCodeAt(0) isnt 65279
editor.setText String.fromCharCode(65279) + editor.getText()
editor.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment