Reindent For a single file vim /path/to/file.js -c 'retab | wq' For multiple files find . -name '*.js' -exec vim {} -c 'retab | wq' \; A useful argument to find is -maxdepth 1 to limit it to the current directory, for example.