Seite wählen

Replace spaces with tabs in Visual Studio 2017

von | Nov 2, 2017 | Windows, Icinga

Visual Studio has several source code edit settings. This defaults to 4 spaces and no tabs by default and is slightly different to what we use in Icinga 2. There we put focus on tabs in our code style.
Editing the Icinga 2 source code on Windows with Visual Studio requires adjusting the editor settings. Navigate into Tools > Options > Text Editor > C# and C++ and adjust the settings to „Keep tabs“.


I accidentally forgot to specify these settings for C# too, and had the problem that half of the Icinga 2 setup wizard code had 4 spaces instead of tabs. Luckily I’ve found this blog post which sheds some lights in the comments.
Hit Ctrl+H to open the replace search window. Tick the icon to use regular expressions and search for „((\t)*)([ ]{4})“. Add „\t“ as replacement text.

Happy coding for Icinga 2 v2.8 – ready for OSMC 🙂

0 Kommentare

Trackbacks/Pingbacks

  1. Monthly Snap November > OSMC 2017, OSDC 2018, Puppet, GitLab EE, Icinga 2, NETWAYS Startupdays, Visual Studio 2017 › NETWAYS Blog - […] Markus announced the last tickets for. Julia blogged live OSMC news, and Michael explained how to replace spaces with…

Einen Kommentar abschicken

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Mehr Beiträge zum Thema Windows | Icinga