Tab Settings in Notepad++ ( Convert Tabs to Spaces)

Tab Settings in Notepad++ ( Convert Tabs to Spaces)

Tab settings in Notepad++ allow you to change the TAB size. You can change the size at the default as well as specific language levels. Default is applicable to all the languages while language level tab settings are applicable only to that specific language. The Default Tab size in Notepad++ is 3.

You can also configure Notepad++ to Replace TABS with spaces using the same settings. This makes sure that there won’t be any tabs in the document.

Let’s explore this further in this document.

Change Tab settings in Notepad++

Open Notepad++ and go to Settings-> Preferences…  Select Langauge. Next, go to the Tab Settings section and choose Default. Click on the blue number beside the Tab size. Enter the new tab size in the small pop-up.

Click Enter to change the default tab size in Notepad++.

Notepad++ Tab Settings GUI

You can also check the Replace by space check box to tell Notepad++ to replace tabs with spaces. This makes sure that there won’t be any Tab in the document.

You should always use this setting. Avoid Tabs in code…!!!

Now, what if you want to have different TAB settings for other languages?

That is also possible. In the Tab Settings section, instead of Default choose the respective language e.g python, and change the size as mentioned above.

So python the tab size is 4 while for others it is 3.

Although, you can set the TAB size at Default and language lever. Personally, I would recommend having the same size for all languages. So set tab size at Default level only

Replace tabs with spaces in Notepad++

Open the document in Notepad++. Enable the show symbol mode. Now, select the Tab as shown below and click CTRL+F to open the find and replace window. Go to the Replace tab, you can see find what field is already selected. Go to Replace with field and press the space bar to add the required number of spaces.

Finally, click Replace All button to replace all the tabs with spaces.

Notepad++ convert tabs to spaces

 

Notepad++ tabs replaced with spaces

Same approach you can use if you want to replace any other character let’s say comma (“,”) with space.

Summary

We, as a developer tend to use TAB while intending the code. Ideally, do not use TAB, as its setting may differ across editors. I can set it as 4 spaces… and someone may set it as 3 spaces. Most of the editor does have different settings for the tab and provides a way to change it.

In this article, we learned how to change the Tab Settings in Notpad++ and replace tabs with spaces using the find and replace functionality.

I hope you liked this small tip. Please share and subscribe.

Leave a Comment

Your email address will not be published. Required fields are marked *