Very close to reverse of this question. I prefer coding with 2-whitespace indentation, but need to have files indented with tabs to align with project convention. What I would like to do is preferably automatically convert 2 spaces upon entry to tab symbol in Notepad++ and have the editor configured to tab length of 2.
A possible manual way for doing this could be Edit->Blank Operations->Space to TAB
but this converts all of my spaces to tabs, even those of length 1 - which are, for example, spaces between function arguments, not just leading spaces.
In a perfect case scenario I'm trying to achieve formatting style as described in this question, but with typing just spaces and the editor taking care of the rest.
I'm on Notepad++ 6.0, but willing to upgrade if this helps
On Visual Studio, Ctrl+K+F did the trick for me. That's the "format selection" shortcut in Visual Studio, which may affect tabs/spaces depending on your formatting settings.
Code is broken up into lines of letters and symbols on a page, which communicates to computers, iPads, smartphones, you name it what to do. You see, with spaces, you format each line of code using the spacebar. While, with tabs, you aligning it with the tab key.
Let me complete the answer of Ari Okkonen to add a workaround to the problem commented by Sergii Zaskaleta of mixed tabs and spaces at the beginning of the line.
A manual way that seems to work: After having edited the file before saving you may try (Works in Notepad++ v6.8.3):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With