4

Some IDEs and Text Editors write spaces instead of TABs.

  1. Is there a way to convert these spaces into TABs when I import a project or some files in Netbeans 8.2 ?
  2. Is there a way to convert spaces into TABs for a Netbeans current project?

I also saw this answer about the Editor settings but it doesn't solve my problem.

Maybe this feature it has always been missing?

If you don't know how to solve this issue using NetBeans, other solutions are welcome.

(Please upvote if you consider this answer relevant :) )

Catalin Copil
  • 41
  • 2
  • 9
  • [1] There is no way to convert spaces to TABs during an import. [2] Regarding your comment "it doesn't solve my problem", can you please clarify what didn't solve your problem? Do you mean unchecking "Expand tabs to spaces" did not solve your problem? [3] What was the language for the file you were editing to convert spaces to TABs? Java? HTML? – skomisa Mar 23 '18 at 02:59

1 Answers1

2

When you uncheck "Expand Tabs to Spaces" (see this answer) you can then use Code -> Format (or SHIFT-ALT-F) to convert your spaces to tabs. See here for more information.

The prolem with this approach is that it also applies other formatting to your code, that you may not want (that is my case).

Cris70
  • 307
  • 1
  • 3
  • 15
  • thank you for writing this answer. I was struggling with the tabs and space issues for few months but never care to search it online. I am glad to find this answer today. – Himadri Nov 21 '19 at 12:27