Home > Blog, Vim Related > Remove trailing whitespace

Remove trailing whitespace

April 28th, 2011 Leave a comment Go to comments

Last blog post, I mentioned you could clean up and reformat a file by using :retab.
This doesn’t remove unnecessary trailing whitespace though. To remove trailing whitespace, use the following:

:%s/\s\+$//
Categories: Blog, Vim Related Tags: ,
  1. No comments yet.
  1. No trackbacks yet.
*