How to eliminate auto tabs?
-
How do I get Notepad++ to stop automatically adding tabs when I use the spacebar? Please send responses to nickajp@…net, not my Google email address.
—
moderator obfuscated email to protect user from spam -
Notepad++ does not enter tabs when you use the spacebar. And we don’t email replies, we just reply in the forum, and you have to read the replies there. (I recommend editing your post to remove that email address, otherwise spam harvesters will abuse that.)
But regarding your problem, could you be more specific about your issue? I am wondering if you are talking about the auto-indent feature, which will automatically indent after hitting ENTER. Or maybe you said it the other way around, and you are typing the
Tab
key, but Notepad++ is entering N space characters – Notepad++ has two modes forTab
: it either enters the the ASCII89 Tab character or N ASCII 32 Space characters, where the mode and N both depend on Settings > Preferences > Language setting on the right.If you use View > Show Symbol > Show Space and Tab, Notepad++ will add a visual representation of spaces and tabs, where space is a colored center-dot, and tab is a colored long-arrow.
If you can show us a screenshot in that mode, and indicate which are the unwanted tab characters (or space characters), we might be able to help you more.
-
Shown below is a snapshot of Notepad++ where I held down the spacebar and it filled the area with tabs instead of spaces.
-
@PeterJones
If I can’t solve the spacebar to tabs problem, is there a way to convert tabs to spaces in Notepad++? -
@PeterJones
Sorry, I found the problem. Turning off Auto-Indent solved the problem. The spacebar would only insert that line of tabs after I started a new line. -
@Nicholas-Piazza-0 said in How to eliminate auto tabs?:
The spacebar would only insert that line of tabs after I started a new line.
Spacebar does not insert a line of tabs, even after hitting enter to start a new line.
When you have auto-indent turned on, hitting ENTER at the end of one line will create a new line, automatically indented with either spaces or tabs, depending on your active language’s tab settings (Settings > Preferences > Language > Tab Settings). It’s the creating-new-line-using-ENTER that puts in the indentation spaces or tabs.
Your screenshot was insufficient for me to tell you what’s going on:
- You didn’t include the line numbers, so I cannot see if you have line wrap on
- You didn’t include context, so I cannot see the line before where you hit ENTER, so I cannot guess how far it should be indented
- You didn’t include the status bar at the bottom, so I don’t know what file language you have active
Also, you should share your settings for Settings > Preferences > Language > Tab Settings for the language of your active file, because then we know what your tab settings are for that language.
Even better, a screen-capture-video animated gif, showing your current file, then you clicking and hitting ENTER, then showing you typing the space, would show us exactly what’s going on. (I use screentogif to capture and automatically upload to imgur, then embed the imgur image using syntax
![](https://i.imgur.com/nASYsAz.gif)
to have the forum show the animated gif from imgur’s site – making sure to use the i.imgur.com URL. Unfortunately, while the forum allows pasting in static images like gif or png directly, without using an external host, animated gifs must be externally hosted. You can use any such tool you want; this is just a suggestion if you don’t already have one to use.)As it is, I just think your previous line is hugely indented (possibly with View > Word Wrap turned on, so you might have thought you were on a different line, even though you’re really just wrapped on the same line), and you hit ENTER, and since you have the active language set to indent using Tab characters, it indents with the correct number of tabs based on the previous line. I don’t think it’s the spacebar at all.
update: actually, you might have a plugin that helpfully converts N leading spaces into another tab character, so maybe after you’ve typed 4 (or whatever N is for that plugin) spaces, the plugin automatically converts those to a single tab, and as you continue to hold down the spacebar, the plugin continues to convert the groups of N into another tab. Sharing your ?-menu’s Debug Info will show which plugins you have, and maybe someone here knows of a plugin that behaves that way (I do not, off the top of my head).
update 2: And I have confirmed that something similar is true, natively: if your language is set to tab-indent, and you have mixed tabs and spaces at the beginning of a line (like ), if you hit TAB at the end of that line, it will convert them all to tabs ( )