3 ms·
Is there an editor that will format the same code file with different preferences? For example, I use 4 spaces instead of tabs and I don't like extra spaces ar
by gabrielsroka 6y ago
Is there an editor that will format the same code file with different preferences? For example, I use 4 spaces instead of tabs and I don't like extra spaces around (). But my teammate might want 8 spaces or tabs, and extra spaces around ( ).
Why can't we both look at the same file based on our personal preferences and have, for example, GitHub convert it to the approved team standard on check in?
This way, maybe we can end the spaces vs tabs debate once and for all, and make everyone happier.
if (dense) {
// mine
}
or
if ( spacey )
{
// theirs
}
- chaorace 6y agoThe premise of the question is a little flawed. Most people just enforce a specific editor configuration via either a pre-commit git script or a plugin-based solution like editorconfig. Once the configuration is enforced, you can configure many (most?) code editors to visualize the whitespace as desired (tabwidth/tabstop tend to be the features to look for).
- vile 6y agoRespecting user preferences is, IMO, the major use-case for Tabs - they display indents at the depth of the viewer's preference, not the author's preference.