At work we have the convention on using 4 spaces for code indentation. I'm accustomed to using tabs
for indentation, but want to follow the convention.
Note: it is not my intention to start a discussion on spaces vs tabs here.
I adjusted my Visual Studio settings to replaces tabs with 4 spaces, but I have some issues adjusting to using spaces.
For example:
How can I easily un-indent code? with
tab
chararaters, I only needed to use backspace one time, with spaces I need to use backspace 4 times.How can I make sure that there is always the correct amount of spaces (not three or five)?
How can I navigate through my code as fast as I could with tabs? (arrow left or right jumps to the next indentation with tabs, but moves only a single position with spaces)
How can I ignore whitespace changes when comparing files?
Idealy, I would like these 4-spaces for indentation to work equally to tab characters.
I work mainly with c# and XML-based files.
Any tips are welcome!
Ctrl
+Arrow left key
/Arrow right Key
will take you to the next non white space character. That's faster than just arrow left/right! – default[Home]
toggles between the beginning of a line and the first non whitespace character. This is usually faster than navigating with the cursor keys. – IInspectable