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. 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 besides Tab size. Enter new tab size in the small pop-up.
Click Enter to change the default tab size in Notepad++.
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 different 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 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.
Same approach you can use if you want to replace any other character let’s say comma (“,”) with space.
We, as a developer tend to use TAB while intending the code. Ideally, you should 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 Tab Setting in Notpad++ and how to replace tabs with spaces using find and replace functionality.
I hope you liked this small tip. Please share and subscribe.