In remove unwanted spaces page in vim wikia, it says:However, this is a very dangerous autocmd to have as it will always strip trailing whitespace from every file a user saves. Sometimes, trailing whitespace is desired, or even essential in a file so be careful when implementing this autocmdWhy is it so? Is there a situation where it's necessary to have trailing spaces in the end of a line?
Dangerous trailing space
whitespace
Is there a situation where it's necessary to have trailing spaces in the end of a line?The two most common that I encounter are:In the original Markdown you need to use two spaces at the end of line to signal a hard newline (in GitHub flavoured Markdown this does nothing, though, since this always adds a newline).For emails the marker for the start of a signature is --<Space>.There may be other situations as well.