Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert tabs to spaces in Notepad++

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.

like image 837
Helephant Avatar asked Jan 18 '09 12:01

Helephant


People also ask

How do I replace a tab with a comma in notepad?

In the Notepad menu bar click on Edit > Replace.... Right click on the Find what field and choose Paste from the context menu, or press CTRL+V. This inserts the tab character you copied into the 'Find what' box. In the 'Replace with' field, enter a comma and click on Replace All.

What command is used to convert tabs to spaces?

To convert tabs in a text file to spaces, you can use the expand command. To convert each tab to a single space character, use the -t 1 option.

How do you show tabs and spaces in Notepad++?

Notepad++ – Show White Space and TAB A lot of Python debugging frustration can be avoided by activating the 'Show White Space and TAB' option from the View > Show Symbol menu.


1 Answers

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:

  1. Go to Settings->Preferences...->Language (since version 7.1) or Settings->Preferences...->Tab Settings (previous versions)
  2. Check Replace by space
  3. (Optional) You can set the number of spaces to use in place of a Tab by changing the Tab size field.

Screenshot of Replace by space

like image 79
mrzli Avatar answered Sep 27 '22 19:09

mrzli