Skip to content

Instantly share code, notes, and snippets.

@jpsirois
Created January 25, 2012 14:28
Show Gist options
  • Save jpsirois/1676509 to your computer and use it in GitHub Desktop.
Save jpsirois/1676509 to your computer and use it in GitHub Desktop.
Recursive Bom Signature Finder/Remover with Vim
alias findbom="grep -orHbm1 \"^`echo -ne '\xef\xbb\xbf'`\" . | sed '/:0:/!d;s/:0:.*//'"
alias removebom="grep -orHbm1 \"^`echo -ne '\xef\xbb\xbf'`\" . | sed '/:0:/!d;s/:0:.*//' | xargs vim -u NONE +'argdo se nobomb | wq'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment