0

NotePad++ is displaying various length tab indentation. Please suggest how to configure to display the tab charater same as notepad.

Tab difference between NotePad and NotePad++

Tab difference between NotePad and NotePad++

phuclv
  • 26,555
  • 15
  • 113
  • 235
dns475
  • 13
  • 1
  • 1
  • 5
  • 1
    I don't get it. Notepad is displaying various length tab indentation as well. – cesarse Aug 12 '19 at 11:56
  • Oh, I think I figured out what you meant. Search for "elastic tabstops for notepad++". There are several plugins that may do what you want. – cesarse Aug 12 '19 at 12:01
  • Hi @cesarse ,I've installed the Elastic Tabstops plugin. It doesn't help. Pls check the attached screenshot. The same text file appers diffently in Np and Np++. Tab appears as equally spaced in notepad but not in Np++. The orange arrow indicates the same [Tab](https://en.wikipedia.org/wiki/Tab_key) in different [length](https://stackoverflow.com/questions/45998133/tab-space-inconsistency-in-a-txt-file-using-php) in space. I prefer to congiure Np++ to display text the same way Np does. – dns475 Aug 12 '19 at 13:50
  • 2
    Now I see your point. Unfortunately, I never heard about such implementation for tabs. Take a look at https://en.wikipedia.org/wiki/Tab_stop to see how a tab is interpreted by editors. Oh! Please note that notepad does *not* use equally spaced tabs as well. – cesarse Aug 13 '19 at 08:10
  • 1
    The only difference I see is that notepad has tag-length equal to 8 spaces and Notepad++ 4 spaces. – Toto Mar 18 '22 at 15:09
  • I’m voting to close this question because this behaviour is not reproductible. – Toto Mar 18 '22 at 15:10
  • also remember to click the checkmark if an answer helps you. Take the 1-minute [tour] to know how this site works – phuclv Mar 23 '22 at 01:15

1 Answers1

0

NotePad++ is displaying various length tab indentation

That's completely wrong. Tabs in most code editors stop at fixed intervals equal to 4 spaces by default. You can clearly see it in your case where the distance gradually reduced until you have 4 characters, and the length is always 4 spaces. You can type more texts in the below line to see how they align

Plain text editors like Notepad OTOH typically uses 8-space tab by default, similar to many terminals. To make tab size 8 in Notepad++ just go to Settings > Preferences > Language and change the tab size for the corresponding language (Normal Text for plain texts like yours)

Notepad++ tab settings

But you shouldn't use tabs at all. The fact that tabs have different interpretations in different environments makes it prohibited or discouraged in modern languages/coding conventions. For example in Python

Spaces are the preferred indentation method.

Tabs should be used solely to remain consistent with code that is already indented with tabs.

So the better solution is to check "Replace by space" in Notepad++ as can be seen in the same preferences dialog above

If you want to convert the old files to space to make it consistent then select the whole text and select Edit > Blank Operations > TAB to Space

Notepad++ TAB to Space

See

phuclv
  • 26,555
  • 15
  • 113
  • 235