Get list of currently open files as a Sidebar

Hi,
I am trying to see if it’s possible to add a list all of the currently opened files into the UI? Possibly this would be as a Sidebar? I’ve looked at the Docs for making a Sidebar and this seems a viable solution, so I think this would innvolve building a treeview with the list of open files, but I’m not sure how I would go about accessing the currently opened files, is there any easy way to access the currently open files?

Here’s a bit of an explanation to why I’m exploring if this is possible. Currently I use the Brackets editor as my main text editor, I’m aware that later in 2021 it is no longer going to be actively supported by Adobe anymore. Whilst this doesn’t mean that Brackets will stop working any time soon I’m keen to explore alternatives, Nova is one that I like a lot of the features but there’s certain functionality I like in Brackets that I was wondering if I could recreate via an extension.

The main function in Brackets that I like is that the currently open files appear in a “Working files” section above the Project File Tree. I often have a lot of files open at once in a project so horizontal tabs quickly become useless for switching between documents, so re-creating some kind of working files section with a list of open files would be extremely useful (and potentially to other Brackets-refugees like me?).

Thanks, any thoughts / suggestions welcome!

3 Likes

The set of open text documents can be accessed through the textDocuments property of the nova.workspace object. This does not, however, currently include any other tab types (such as image files, terminals, and file browsers). We can consider a more exhaustive list as a feature request!

2 Likes

Great, I’ll take a look at that and see how I get on!

1 Like

I emailed Panic about this same thing last Friday. I am also a Brackets user and I can’t stand the Tabs being used for the current opened working files since they are very limited. I also have a lot of files opened in Brackets as well, and tabs just won’t cut it (also a reason why I don’t use VS Code). I thought maybe I would have to develop something myself, but I hope someone else does, and soon.

Hopefully this and perhaps a port of the Brackets’ Dark Theme would make it to Nova. If I knew how to develop for Nova, I’d give it a shot.

1 Like

Hi, yep, it wasn’t until I started trying a few other text editors that I realised how much I like the way Brackets deals with multiple files, horizontal tabs quickly get overwhelmed with a lot of files open. I’ve had a little look at how to create a custom Sidebar to do this in Nova, however at the moment I’m just going to keep using Brackets as it’s not going to stop working anytime soon. Eventually I’ll either get forced to find something new or if I find a bit of free time then I’ll explore creating a custom Sidebar in Nova some more.

2 Likes

@Danny: You may wanna search for “Brackets” in the extension library. Because I’m a long-time Brackets user too, I made a Nova theme based on Brackets.

3 Likes

@hendrik Ah thanks, I hadn’t seen that theme, that looks pretty good!

3 Likes

I got the Nova trial 8 days ago and the first thing I did was search for a Brackets theme. There was nothing. I just checked again as you said, and I see you released one 5 days ago. This looks perfect. I was having a hard time adjusting to all the other weird dark themes. Thanks!

2 Likes

I wouldn’t say other themes look weird. It’s just that if you’re used to Brackets everything else looks like a color explosion :joy:

I’ve just noticed someone posted an extension which allows you to open up Tabs as a list of files in a side bar.

It seems very promising, though it is missing some of the small things found in Brackets such as being able to re-order files by dragging, or appending the name of the containing folder when multiple files of the same file name are opened.

1 Like

I hope I’m not speaking out of turn, and please forgive me if this is not what is desired.

I noticed that the files pane has little filter icons at the bottom, and you can show recently open files (I believe that lists all the files opened during this session) as well as only show files with git statuses (updated or deleted or added). Would this not fit the bill? Of course the drawback is that you can only have one files pane in your list of icons, so you can’t have a filtered files pane and a full files pane at the same time. Just thought this might be pertinent, as those views automatically show your files organized by folder.

This view just replicates the file structure filtered to opened files, but you still need to toggle between the filter to browse files you need.

Those of us migrating from Brackets have the option to open a project and view all files in a hierarchy AND also view a flat list of files that are actively opened, without having to deal with a cluttered outdated Tabs View.

Tabs are inconsistent with their sizes, and are difficult to manage with many opened files, a flat list offers a better cleaner view to switch between active work files.

It’s a workflow issue when migrating from Brackets.

For example, this is what the Working Files panel looks like in Brackets.

Screen Shot 2021-04-13 at 8.36.27 PM

In Nova it would be a long horizontal strip of tabs that are ellipsis’d, with each tab growing smaller as more files are opened, at which point it becomes unusable.

2 Likes

Hi to all.

I try to implement directory name to TabList and now I have a little big question.
I don’t know which option is the best:

1.- directory before name
preview-grouped

2.- directory after name
preview2

Please, let me know.
Best regards and Merry Christmas.

1 Like

I like the dir name after the file name since I am more focused on the file and not the dir.

Great!
I update it with directory name after file name and a little change in name sorting.
I hope you like it.

Captura de pantalla 2021-12-28 a las 9.52.40

Best regards.

1 Like

It has been awhile. I see the update and it’s good with the additional context. It’s almost like Brackets now.

If you could add the ability to re-order files by drag and drop, it would be perfect like Brackets. Since I can’t re-order the files that are opened, I had to switch back to tabs since my workflow depends on being able to re-order files as I work on them, or a collection of them.

The default tabs view allows this.

Hello Danny.

TreeItems and TreeView has no options to drag and drop. I’ve searched for this in the api reference but I can’t find it: Nova

If you have any idea how to implement it, let me know.

Best regards.

Hey guys, this was bugging me too so I decided to make my own extension.

Tabs Sidebar Nova Extension

I was going to fork @gejobj 's extension, but there were too many enhancements and refactors I wanted to do so I started over.

My extension allows you to rearrange the list using up/down buttons, among other features.

It uses AppleScript for some commands, to access Nova menubar items that extensions normally don’t have access to, such as “Close Tab”, and to be able to switch to remote tabs. For this reason it will require you to grant accessibility permissions in System Preferences.

There are still more features I am planning on adding. Let me know if you find any bugs or have any feedback.

Cheers.

Hello @eablokker.
Nice work! It’s looks great :slight_smile:
Best regards.

There was a bug in my initial release where the shell scripts were not executable. Should be fixed now.