Convert tabs to spaces in Notepad++

How do I convert tabs to spaces in Notepad++?

I found a webpage that suggests it's possible, but I couldn't find any information about how to do it.

I would like to be able to do that, because some web forms don't respect code with tabs in them.


To convert existing tabs to spaces, press Edit->Blank Operations->TAB to Space .

If in the future you want to enter spaces instead of tab when you press tab key:

  • Go to Settings->Preferences...->Language (since version 7.1) or Settings->Preferences...->Tab Settings (previous versions)
  • Check Replace by space
  • (Optional) You can set the number of spaces to use in place of a Tab by changing the Tab size field.
  • 按空间替换屏幕截图


    Obsolete: This answer is correct only for an older version of Notepad++. Converting between tabs/spaces is now built into Notepad++ and the TextFX plugin is no longer available in the Plugin Manager dialog.

  • First set the "replace by spaces" setting in Preferences -> Language Menu/Tab Settings .
  • Next, open the document you wish to replace tabs with.
  • Highlight all the text (CTRL+A).
  • Then select TextFX -> TextFX Edit -> Leading spaces to tabs or tabs to spaces .
  • Note: Make sure TextFX Characters plugin is installed ( Plugins -> Plugin manager -> Show plugin manager , Installed tab). Otherwise, there will be no TextFX menu.


    Settings -> Preference -> Edit Components (tab) -> Tab Setting (group) -> Replace by space

    In version 5.6.8 (and above):

    Settings -> Preferences... -> Language Menu/Tab Settings -> Tab Settings (group) -> Replace by space

    链接地址: http://www.djcxy.com/p/28636.html

    上一篇: Tab Vs Vim中的空间首选项

    下一篇: 将制表符转换为Notepad ++中的空格