vim and too many spaces
Tuesday, January 17, 2012 at 12:11PM When pasting code into vim you can often get some really annoying spacing.
This first command re-indents the file as vim thinks it should be indented. Of course you gotta teach vim the file type you’re working with but that’s another story.
<esc>gg=G
This one deals with repteated (defined here are two or more) spaces characters within a line by reducing them to one for the whole file
:%s/\(\s\)\{2,\}/\1/g
vim 