How to remove a tab only

I add a file into a project - Sketch->Add File. A tab is added. Now I have 20 tabs and want to free some space for a new one. But when I go - Tab->Delete - it deletes a file along with a tab!!! How can I delete a nab without deleting the corresponding file?

The tab is the file and the file is the tab. The IDE shows a tab for every file in the root of your sketch folder.

The IDE does not show the files that are in the src subfolder of the sketch, yet it does compile the source files under that folder. So you can move source files there if you don't want them exposed to the user in the IDE. Information on that here:
https://arduino.github.io/arduino-cli/latest/sketch-specification/#src-subfolder

Haha, gotcha.

I just happen to have needed to delete a tab recently and it looked like it was gonna delete the file, so

I opened the sketch folder and copied the file I was afraid it was going to delete to another folder then

deleted the tab and took a look, sure enough the original was… gone.

So copy out any files you need to preserve.

a7

But I do want to see files in tabs - I add some code and compile it. But after I done with the file I want to hide the tab it cause it hard to go through 100 tabs looking for a file to add or to change the code.

Rename the tab file from source.ino or source.cpp or source.c to something else e.g. unused.h

It will still remain as a tab file in the IDE but it will not be compiled.
If you want it to disappear from the IDE, rename the extension in File Explorer i.e. avoid INO, CPP, C, S, H

I don't see a problem with the number of "tab files". They appear in alphabetical order. So you can rename the "less edited" tabs to start with "z"

David.

Sorry, but the Arduino IDE does not provide any way to do this. It is designed that way intentionally because all the files are always compiled. In the case of .ino files, they are even concatenated into a single file before compiling, in the specific order they are shown in the IDE. So it would be confusing for many users that code they can't see is being compiled.

What you can do is use the text editor of your choice (e.g., VS Code, Notepad++) for writing your code, only using the Arduino IDE for compiling and uploading. If you are using the classic Arduino IDE (e.g., 1..8.15), it even has a File > Preferences > Use external editor setting specifically for this use case.

There are many inconvenients in the IDE but this is too much.

Hi,

What project needs over 100 files?
What is the application?
There may be an easier way to configure your code without 100 files in the sketches root directory.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

At least I can say - I'm frustrated. It's not a kid play, my projects consists of hundreds of files. It's no way to manage it.

Eventually everyone reaches a limit and switches to a better dev environment. Eventually is never for many. :wink:

a7

Dear Tom
I have some projects with hundreds of files. Some libs like LWIP, BlueNRG, etc have tons of files without writing any code. At this particular projects it'll be like 40-50. still need to be managed.

The only IDE I managed to set completely (compile+flash) to work with ESP8266. See no way but stick to it.

I have projects that contain multiple "uncompiled" files.
I would feel uncomfortable with 100 tabs.

If you are developing a "library" via the IDE, I strongly advise you to use an external editor and a conventional directory structure.
Or create a subdirectory for your "unused" files. Then you can move a file in or out of the "unused_files" subdirectory.
Or perhaps put your H files into an "include" subdirectory.

David.

Thank you. I'll try.

Hi,

Didn't answer any of my questions.
Only trying to help, by getting ALL the facts.

Tom... :smiley: :coffee: :coffee: :coffee: :australia:

Here we see the problem. You should never dump a library like that into the root of the sketch folder. If you do absolutely need to bundle a library with a sketch, put it in the src subfolder. The library is a separate project from the sketch, and so you should work on it separately from your sketch.

As I explained, you can continue to use the Arduino IDE for compiling and uploading, only switching to a more advanced editor for writing the code.

Libraries live in the libraries subdir. Or are you modifying them / tailoring them to the project (hint: bad idea to create a plethora of different versions)

Eclipse / Sloeber

But then compile time errors are not highlighted. I have to search it in the external editor going thorough 1000 lines.

Does it means I can set an Arduino plug-in in the Eclipse IDE?

Well...It looks awesome!
But when I create a new project I have -
In Platform folder .../arduino/hardware/avr only
In Board - no esp boards.