How do I convert tabs to spaces in Notepad++?
I found a webpage that suggests it's possible, but I couldn't find any information about how to do it.
I would like to be able to do that, because some web forms don't respect code with tabs in them.
How do I convert tabs to spaces in Notepad++?
I found a webpage that suggests it's possible, but I couldn't find any information about how to do it.
I would like to be able to do that, because some web forms don't respect code with tabs in them.
To convert existing tabs to spaces, press Edit->Blank Operations->TAB to Space.
If in the future you want to enter spaces instead of tab when you press tab key:
Settings->Preferences...->Language (since version 7.1) or Settings->Preferences...->Tab Settings (previous versions)Replace by spaceTab size field.Settings => Language Menu/Tab Settings => Replace by space (In the bottom right corner). It is almost as mrzli said, but I had a hard time noticing where it said Tab Settings. (I know I am blind!)Edit -> Blank Operations -> Tab to Space. Also the Tab Settings are now in Edit -> Preferences -> Language. Although, I don't understand what the Tab Settings does. I've checked the Replace by space box for javascript, but I still get a tab when I press the tab key. Shouldn't it print 4 spaces instead?Obsolete: This answer is correct only for an older version of Notepad++. Converting between tabs/spaces is now built into Notepad++ and the TextFX plugin is no longer available in the Plugin Manager dialog.
Preferences -> Language Menu/Tab Settings.TextFX -> TextFX Edit -> Leading spaces to tabs or tabs to spaces.Note: Make sure TextFX Characters plugin is installed (Plugins -> Plugin manager -> Show plugin manager, Installed tab). Otherwise, there will be no TextFX menu.
Settings -> Preference -> Edit Components (tab) -> Tab Setting (group) -> Replace by space
In version 5.6.8 (and above):
Settings -> Preferences... -> Language Menu/Tab Settings -> Tab Settings (group) -> Replace by space
You need to replace \t - make sure you use extended mode!

Follow this procedure to convert spaces to tabs or vice-versa:

In version 5.8.7:
Menu Settings -> Preferences... -> Language Menu/Tab Settings -> Tab Settings (you may select the very language to replace tabs to spaces. It's cool!) -> Uncheck Use default value and check Replace by space.
I did not read all of the answers, but I did not find the answer I was looking for.
I use Python and don't want to do find/replace or 'blank operations' each time I want to compile code...
So the best solution for me is that it happens on the fly!
Here is the simple solution I found:
Go to:

There is no 'Edit Components' tab in the preferences setup. You need to go 'Language Menu/Tab Settings', there is an option in there to control tab behavior. You can even set it to work differently depending on the language of the file.
I follow this simple way:
Find/repace).Find What: field. But don't worry.space in Replace With: field.Replace All .See:

Note: This method applies to reverse (Replace a space by a tab) case too.
If you happen to work in a Unix environment, the expand command is what you need:
In version 8.8.x:
Now the Tab/Space setting has moved to Settings-> Preferences -> Indentation. The working is pretty similar to the original.
Simple way is to search and replace TAB.
xTABy, xxTABy and xxxTABy. Expect the y characters to be lined up vertically. The replace in this answer will not do that. Also, the RED text looks incomplete and possibly wrong. Entering four spaces after clicking the Replace button is not very useful.