How to customize the editor tabs


#1

the editor tabs show the directory when I have 2 files of the same name open to disambiguate. This is a good thing.

But I want to show the directory all the time without having to trigger the tooltip because I have many paired files (same name in …/src and …/tests) and I might just have one of the pair open. Also, I am working with a large old codebase that has challenging structure and naming conventions.

I am looking for a pointer to the place to start.

I think I need to modify the atom/abs package (part of atom core) to do this because I cannot find a configurable bit to do it.

  1. Am I correct? I have nuclide installed - does that matter?
  2. that package is not in my .atom/packages so where is it (Debian 9 linux)?
  3. Is there a way to do what I want and have it survive an upgrade to atom/tabs? Do I finally have to learn coffeescript?

Is there a better way to do what I want?


#2

You are correct, and Nuclide shouldn’t matter if it doesn’t replace tabs.

that package is not in my .atom/packages so where is it (Debian 9 linux)?

It’s in the ASAR archive bundled with the executable. But you don’t need to mess with that. Just clone the package repo. No work has happened since the last release, so you don’t even have to check out a specific commit.

Is there a way to do what I want and have it survive an upgrade to atom/tabs? Do I finally have to learn coffeescript?

Yes and probably, but only if you want to.

APM gives you the option to use apm link in a package code folder to create a symbolic link from .atom/packages. When Atom starts up, any package in .atom/packages with the same name as a core package will be loaded instead of the core package. Using these two behaviors, you can download and edit any core package you want, then reload Atom and see your changes in effect. If you want to revert to the core package, just delete the symbolic link and your code is fine. You can also use apm link -d to create the symlink in .atom/dev/ and have it only activate in developer mode, but I find it tedious to reopen Atom in developer mode when I’m messing with a package, so I do everything in normal mode.

As for CoffeeScript, it would probably be best to make your changes in the language and dialect spoken by the package authors, but you can also plug the whole package through a CS-to-JS converter, paste the JS into a renamed code file, and make your changes there. Change the package main file in package.json and you’re good to go. This does mean that your changes are unlikely to be able to be merged into the package (I remember this coming up once before, so maybe there are people aside from you who would benefit from this change). However, it’s also the case that the Atom dev team has been migrating away from CoffeeScript to ES6, as new JS solves some of the main problems that CS solved, but with better support. If you felt truly dedicated to promoting excellence for Atom’s tabs, you could also rewrite the modestly-sized package in JavaScript (or just convert and clean up and verify that all the tests pass), and such work would probably be well-received.


#3

Tks for comprehensive reply!

Now I just need to get started :blush:

I was going to hard code my change. I would really like to give it back to others so I expect something configurable would be better. And in ES6 :smile: