Skip to content

Instantly share code, notes, and snippets.

@moble
Created March 20, 2014 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save moble/9671487 to your computer and use it in GitHub Desktop.
Save moble/9671487 to your computer and use it in GitHub Desktop.
Use Emacs to clean up whitespace in a whole bunch of files
# Remove trailing whitespace, and replace tabs with the appropriate number of spaces
for file in `find . -name "*.?pp"`; do
echo "$file"; /usr/local/bin/emacs --batch "$file" \
--eval '(setq-default indent-tabs-mode nil)' \
--eval '(whitespace-cleanup)' \
-f 'save-buffer'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment