Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show file name in tab if some or all files are in the same working directory #2

Open
piccobit opened this issue Jun 18, 2015 · 9 comments

Comments

@piccobit
Copy link

Working with a lot of files in the same directory, the tabs also show the identical working directory, which makes it really hard to remember which file is in which tab.

@tpope
Copy link
Owner

tpope commented Jun 18, 2015

I personally don't really work this way, but I agree, it would be ideal to be more flexible here. Would adding the additional constraint that it only shows the file name if a tab contains just a single window still adequately cover your use case?

@tpope
Copy link
Owner

tpope commented Jun 18, 2015

Bigger picture, I'd also be curious to hear what your ideal tabline would look like. Do you even care about the current directory? I'm trying to get a feel for what different people find important and strike a balance in the default.

@tpope
Copy link
Owner

tpope commented Jun 18, 2015

I did a quick spike in the tab-filename branch. I'm not really happy with it yet but it's a start.

@piccobit
Copy link
Author

Hi Tim,

do be honest, I don't care about the current directory at all!

Your suggested constraint sounds great and would cover at least my use cases.

tpope added a commit that referenced this issue Jun 19, 2015
@justinmk
Copy link

FWIW I find showing the current directory the 'titlestring' to be adequate.

set title titlestring=%{getcwd()}

Another alternative is to extend <c-g> (or a similar mapping, e.g. <m-g> or 2<c-g>) to include CWD. My point is that CWD is important, but not important for non-focused tabs.

@tpope
Copy link
Owner

tpope commented Jun 20, 2015

I get not caring if the directories are the same but the second I start opening things across projects I find the file name super frustrating. I get paths like ~/s/w/m/a/c/application_controller.rb or ~/.r/g/2/g/d/a/c/d/registrations_controller.rb which are super confusing when you are trying to figure out which tab you opened Devise in. I'm open to incorporating the file name but the project name will definitely be staying, at least when it's different from the current tab.

I'm awaiting feedback on the branch before proceeding further.

@justinmk
Copy link

paths like ~/s/w/m/a/c/application_controller.rb or ~/.r/g/2/g/d/a/c/d/registrations_controller.rb which are super confusing

I agree. Project name could be useful, but given that working directories may be window-specific, I have hitherto assumed that showing it in the tab could be misleading. But maybe not.

@tpope
Copy link
Owner

tpope commented Jun 20, 2015

In the event a tab has multiple per-window working directories, they'll all be shown, joined with commas. This works great but makes it less clear what to do with the file name in that case.

The branch I created currently shows single window tabs like this, assuming the file is within the window's current directory:

~/.r/g/1/g/devise-2.0.4/a/c/d/registrations_controller.rb

I like this style, but it can get really verbose quick. There are also times where you still might want to see a filename but it decides to show the current directory. Here are a couple of variants I'm considering:

  • Leave off the directory if it matches the current directory. This is denser, and pairs well with the titlestring=%{getcwd()}, but means the labels will change as you cycle through windows and tabs, which I'm not too keen on. Plus, I like looking at the current tab to know what project I'm in.
  • Show filename if the directory matches, directory if it doesn't. Same problems as above.
  • Show the current window filename plus an indicator if a tab has multiple windows with the same directory.
  • Use filenames if no tab has a local directory, and switch to directories the second :lcd is called.

I am also struggling with how to make this configurable without getting too bloated. Shoehorning any one of these into flagship#tabcwds() is dicey; adding multiple could get unmanageable.

@piccobit
Copy link
Author

Didn't work with multiple windows in a tab before, so I'm now understanding a little bit better your intention for having only the working directories in the tab mane. Makes totally sense to me.
For me it would be fine to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants