Fix Mixed Tabs

Free

This detects when you have mixed tabs and spaces and offers to fix them for you automatically.

(16) Review
Visual Studio
2013, 2012, 2010
Download (8,723)
11/10/2013
2.3
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (16)
Q and A (9)
Sign in to write a review
Sort by:

by AdolfD | July 25 2014

Useful Extension. Great Job!!1

by GeoffArmstrong | November 16 2013

This is an absolutely necessary plugin for code pedants like myself who keep Show Whitespace on at all times and cringe whenever we see source code with tabs mixed with spaces. Thanks for updating it for VS 2013, Noah!

by Dmitry Gurinovich | January 29 2013

Really useful extension.

by ctaggart | November 06 2012

Exactly what I was looking for! I'm currently using WinJS for a Windows Store App in VS 2012 and this works great for the .js, .css, and .html pages that contain mixed whitespace. We use spaces. The online code diffs looks awful when tabs sneak in to the code.

by Alesha911 | October 15 2012

Excellent helper for detecting some team member's screwed up Visual Studio settings. Thanks!

by tpage1975 | July 02 2012

Endless annoying pop-ups and selecting 'Don't show again' doesn't work. I want to keep productivity tools because of the useful solution navigator but I may just have to get rid of it because of this pointless broken tab 'tool'...

Noah Richards July 04 2012
| Edit |
Delete

You can disable individual extensions inside the productivity power tools. I'm not sure if the version there is up-to-date with this one, as I fixed bugs like the one you mention awhile back. Thanks for your feedback.

by Tzoola | February 28 2012

In our software we must not use tabs - only spaces. It helps a lot!

by pirahawk | March 23 2011

I have only added one star becuase it wont let me submit with 0 or negative stars. nuff said

by Brandopolis | October 08 2010

Can't get it to stop bothering me.

by Michael L Perry | July 31 2010

Clippy is back, and he's in Visual Studio!

I have better things to worry about than whether my whitespace takes up 1 or 4 bytes. I uninstalled the Power Tools extension because it included this thing, and I couldn't turn it off. That is without renaming DLLs, installing separately, and jumping through other hoops.

by Shimmy Weitzhandler | July 07 2010

I keep on getting annoying popup over and over, even I choose "Don't show again." few seconds later it shows up pointing its middle finger to me.

by uıɹos | April 21 2010

It looks very slow on VS2010 and also when you save the tabified file it will appear again asking to Tabify again. :(

Noah Richards February 28 2012
| Edit |
Delete

Should be fixed with v2.1

by Andrew L Arnott | February 21 2010

Handy, and I like that it stays out of the way until it's needed.

But it was REALLY slow (40+ seconds) in untabifying my 27,000 line XML file when only a few dozen lines had tabs in them. Doing a simple Find & Replace to fix it takes only a split second.

by MWatts | February 19 2010

by miridfd | February 04 2010

This sounds great but the extension is not getting installed. I have VS2010 LCTP3 version 30109.1. Any idea?
Thanks

by codeod | February 03 2010

We got lot's of mixed Mvc Views and CSS. Been wanting something like something like this for ages. Works great!

I wish it could also remove tabs from the ending of lines as it does not seems to do this.

Sign in to start a discussion


  • Read ident style from .editorconfig
    1 Posts | Last post April 01, 2014
    • It would be good if extension read .editorconfig (http://editorconfig.org/) and suggest only one option (fix mixed tabs or spaces).
  • VS 2013 version?
    2 Posts | Last post October 30, 2013
    • Love this tool...  Any chance we can get a version that works with Visual Studio 2013?
      
      Thanks!
    • Sorry! I'm working on it, but I lost my windows VM and so I had to rebuild things (a few days of installing software and updates). I should be all set up to rebuild and then test with vs2013, so I'm hoping to get it done this weekend. -Noah
  • Only for rw files
    1 Posts | Last post March 21, 2013
    • Hi,
      
      Is it possible to disable this extension for files that are read-only ? If I haven't checked in a file I don't want to edit it just to fix tabs.
      Thanks !
  • How do I get the information bar back?
    2 Posts | Last post April 01, 2011
    • I must have accidentally clicked on "don't show the information bar anymore" and now the "fix tabs?" information bar never displays.  How do I get it back?
    • It only disappears for the current instance of Visual Studio, so closing and restarting VS should bring it back.
      
      -Noah
  • How do you remove this?
    2 Posts | Last post February 23, 2011
    • I've uninstalled this extension but every code file still shows the header bar but none of the buttons work.
    • I believe this extension is still also included with the Pro Power Tools.  If you have that installed, then you'll have to disable that version of the extension (Tools->Options->Productivity Power Tools).
      
      -Noah
  • Auto Tabify or Untabify
    1 Posts | Last post September 30, 2010
    • Couldn't there be an option in this cool tool to automatically tabify or untabify the page as soon as this app find a mixed tabs file instead of having to click every time on the Tabify button to make it work ? Like a checkbox in Options -> Productivity Power Tools -> Fix Mixed Tabs for example ?
  • Not works with sql files
    5 Posts | Last post September 18, 2010
    • When I open an sql file from a database project, mixed tabs not detected.
    • Is it a file on disk, or is it generating the SQL by pulling it out of the database?
      
      In it's current form, the extension requires there to be an on-disk representation of the buffer before it'll do anything, essentially because otherwise saving the result isn't a meaningful operation (as far as the extension logic can tell).  I'll take a look at alternatives, but I'm not too hopeful :-/
      
      Thanks!
      -Noah 
    • I found that actually it works, but a strange (designed?) way:
      
      I have an ident size 3 and I'm using keep tabs. If the file not contains at least one tab and at least three space the tabify never kicks in. Also if the leading tabs ends with spaces the spaces won't remove.
      
      Example (the same for any file not only for sql scripts):
      
      ->->->.SELECT
      
      Tabify won't remove the space between the select and the last tab.
      I think when I choose "tabify" the leading spaces should be divide by 3 then replaced with tabs and finally the remaining spaces should be removed. 
      
      In summary "tabify" should never leave any single leading space in the document.
      
      
      
      
      
      
    • Ah, I see.
      
      The extension uses the definition of Tabify that VS uses, which isn't the same as, say, fix formatting.  Specifically, it never modifies the amount of indent, just switches each indent-level's worth of spaces into a tab, leaving the existing indent level in place.  You should try format document, to see if that works.
      
      As for the last thing you said ("'tabify' should never leave any single leading space in the document"), there are people who actually use settings like tab size = 8 and indent size = 4, so you can get in situations where 3 indent levels is (intentionally) a mix of tabs and spaces.  It was actually a point of great contention when we *removed* separate tab/indent sizes in the middle of Dev10 and put them back right at the end :(
      
      Long story short, I'm sorry for the confusion :(  If format document (or select all -> format selection) doesn't work for you, send me an email (noahric @ ms) and I'll see if I can write you up an extension that does what you ask (removes the extra spaces after the tabs in the indentation).
      
      Thanks!
      -Noah
    • Unfortunately there is no format document option for sql scripts in vs. For other files types like c# where format document is available the "fixed tabs" extension is not required at all. For that files I use the "format document on save" feature from powercommands.
      
      Most of the files where we have mixed tabs are designer/tool generated files. Some of these files (like a winform designer file) auto-generated and so pointless to fix mixed tabs. 
      But there are files which generated only once: templated files, imported sql scripts and so on. For these files would be very useful when the extension remove all leading spaces. All of my indenting settings (for any file type) using tabs instead spaces. These settings are 100% ignored by visual studio built in tools (the tools generating files usually with 4 spaces indenting). Would be a nice feature of mixed tabs to fix these files.
      
      Anyway I don't expect from mixed tabs to format a document, I think we only want to fix indenting, nothing more.
      
      Thanks for this great extension :)
  • Need to ignore verbatim strings
    2 Posts | Last post July 27, 2010
    • Hi Noah,
      
      I was just working on some unit tests that relied on some strings matching.  The Tabify button changed some spaces to tabs and my unit tests broke.  Can you fix the tool to ignore verbatim strings that use the C# "@" symbol.  Here is an example:
      
      Assert.AreEqual(@"
      line 1
          There are 4 spaces to the left of this line that tabify turns into a tab character.
      line 3", str1);
      
      Thanks.
      (Do you know if this will get synch'ed into the Pro Power Tools, that's how I had installed the tool?)
    • Hey Philip,
      
      No promises, but I'll take a look to see how easy it'll be.  I have two worries about fixing this, though:
      1) It will be slow to use the language service to classify every line in the file to see if any are in strings/when replacing, and even that would rely on the language service classifying the whitespace at the start of the line as a string (I'm not sure if any/all do).
      2) I could write a custom parser for it, but it would have to be language specific, and I'd rather not do that.
      
      Still, I'll take a look and see just how bad it is.
      
      Thanks for reporting this!
      -Noah
  • Tabify not working and perf issues
    6 Posts | Last post July 12, 2010
    • Hey all, if you've seen issues around performance or the information bar showing up again and again even after clicking Tabify (and then saving again), can you give out version 2.1 or later a try and see if it fixes your issues?  Thanks!
      -Noah
    • Hi, I'm not able to remove this extension from VS 2010.  I thought this extension would be pratical, but I have to many files.
      
      I tried to unistall by 2 ways: 1) in VS 2010 - TOOLS - EXTENSION MANAGER or 2) in AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\ I deleted the folder.
      
      For both ways, I restart VS2010 but the message "You have mixed tabs and spaces.  Fix this?" is still appearing.  Do you have a way to remove this message?
      
      Thanks,
      
      
      François
    • Do you have the Pro Power Tools installed?  They put a version of it in there as well.
      
      -Noah
    • Geez, that's my problem.
      
      Is there a way to turn this off in Pro Power Tools?
      
      Thanks,
      
      
      François
    • Not in the current version, no :-/  They are planning that for future releases.
      
      You have two options, though:
      1) Find the dll for FixMixedTabs (I think it is still called that) in the power tools extension folder and rename it to .dll.DISABLED
      2) Install the standalone version again and disable the extension (the power tools version disables itself if the standalone is present, and it doesn't check to see if the standalone is enabled or not.  Net effect is both are disabled)
      
      -Noah
    • Hi Noah,
      
      thanks for the tips.  I did 1) and it's working.  The DLL name is FixMixedTabsProPack.dll.
      
      Have a nice day!
      
      
      François