21

Occasionally, I use Notepad to edit some form of code/html, which means I need to tab a lot. The default indent size when hitting tab is eight spaces when ideally I'd like it be four.

Is there any way to change this setting?

3
  • 7
    Just in case someone's wondering "why stop at every 8th column?" This is the standard for text mode which DOS and Unix/Linux are consistent with as well. Since Windows Notepad was provided for Windows users to edit plain ASCII text files, most of which would have been created in a pre-Windows text mode editor that likely implements tabs in the same manner (because plain ASCII text file users would expect this behaviour), it was important to preserve the tab stops consistently to ensure accurate editing. Jun 18, 2011 at 5:31
  • 3
    I'm suprised no genius ever has reverse engineered Notepad to hack in this much wanted change... Mar 6, 2015 at 16:13
  • 1
    @GrasDouble, it doesn't need to be genius to create a notepad clone, neither it worth to reverse engineer it.
    – milevyo
    Feb 15, 2019 at 18:21

4 Answers 4

14

Not with Window's Notepad, but the default tab for Notepad++ (free) is 4 characters. And it does A LOT more.

http://notepad-plus-plus.org/

4
  • Good plan! By the way, I don't mind getting my hands dirty in the registry.
    – aligray
    Jun 18, 2011 at 5:01
  • 2
    @aligray It is hard-coded as I expected, but I actually did search the registry before answering.
    – KCotreau
    Jun 18, 2011 at 5:03
  • Appreciate that, I'll just stick to Notepad++.
    – aligray
    Jun 18, 2011 at 5:04
  • There's also Notepad2 by Florian Balmer. It has crashed me only once in about ten years. Light-weight and yet feature-rich. • And of course you can change the tab width hitting Ctrl-T.
    – Lumi
    Jul 23, 2023 at 15:04
1

the way i use the windows internal notepad (short notes, quick edit things,...) is with AutoHotKey. i replaced the tab-key with a little loop to send spaces instead like this:

#NoTrayIcon
return

#IfWinActive ahk_exe notepad.exe
tab::
  loop 2
    send % A_Space
  return
#If

that loop 2 means, its sends 2 spaces. it can be a part of an existing script, like i do or as a single script in autostart.

1
  • 1
    this always send 2 spaces which doesn't work like a tab, which stops at fixed intervals
    – phuclv
    Mar 19, 2022 at 4:39
1

Windows Notepad is VERY old. It existed before Windows. Here's a little known "undocumented function":

  1. Create a new text file using Notepad.
  2. Type .LOG as the first four characters. (They must be uppercase).
  3. Save and close the document.
  4. Reopen it.

I create a document named MEMO.TXT wherever I work (I'm a free-lance consultant), and use the document for quick notes -- during phone calls, meetings, as reminders, etc.

4
  • 4
    How does this answer the question, which is "Is it possible to change the default tab-size in Notepad?" Dec 9, 2022 at 18:13
  • 2
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Dec 9, 2022 at 18:35
  • 1
    This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review Dec 9, 2022 at 18:36
  • This doesn't answer the question but I didn't know this so +1. • This is akin to the concept of a "modeline" (such as found in Vim) which is what I was looking for when coming here. It allows you, by writing a magic line in a file, to have file-specific settings, for example to set the tab width to 20 to write simple TXT tables. Quite useful. But neither Notepad nor Notepad2 appear to have the "modeline" feature - except for the special .LOG case you pointed to. • And by the way, Notepad2 has the .LOG feature, too.
    – Lumi
    Jul 23, 2023 at 15:12
0

Windows notepad doesn't allow to modify the tab length. This is one of the motivations cause I have replaced it with notepad++ that does a lot more and allows the user to set the tab length as well: go to the menu Configuration > preferences > tabulations. In this mask there is the option to set it freely. How to replace ms win notepad with notepad++: Download n++ from the developer web site and when you install it the install wizard at a certain point shows an option to replace the built in windows notepad: check it and continue the setup procedures. Done. From now on you can enjoy the power of one of the best free text editors.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .