Setting up your editor correctly can make working with other developers much less painful (for everybody). Below are some things that I believe every developer should do when editing source code. Any good IDE or editor should have settings to do these things automatically – the points below are paired with their Sublime Text 2 setting.
- Trim trailing whitespace –
- Always use Unix line endings (LF) -
- Ensure files end with a new line –
- Automatically detect indentation style –
- Or, failing the above, have a way to quickly switch between indentation styles.