helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
31.6k stars 2.34k forks source link

Add an option to show workspace name in editor.statusline #8966

Open petrjahoda opened 7 months ago

petrjahoda commented 7 months ago

Add an option to show workspace name in the editor.statusline.

Why?

When working in multiple projects at once in, for example, three tabs in full screen terminal, it is sometimes confusing, when coming back from the pause, to orient oneself in which workspace/project one is working.

Screenshot 2023-12-01 at 21 40 58
pascalkuthe commented 7 months ago

What is the workspace name supposed to be? Helix doesn't have a concept of a workspace beyond cwd/.git directory

petrjahoda commented 7 months ago

Sorry for the confusion, I used the term from documentation.

image image

In other words, it is the current working directory, in which Helix is open in.

Sammo98 commented 6 months ago

@petrjahoda

I've got a draft sort of ready for this:

Screenshot 2024-01-09 at 12 54 08

Just confirming, let's say you start helix within dev/helix, is the expectation that the you see dev/helix/ no matter which file you enter into? Or that it should always be the parent directory of the file, such that if you open the file dev/helix/terminal/test.rs, you would then see dev/helix/terminal/ ?

Other question I suppose is would you want the full path or just, as per example above, helix

petrjahoda commented 6 months ago

Hi Sammo98, from my point of view, from all the examples above, it should be only helix, because that was the name of the directory from where i started helix. That is also the response to your next question between full path or just the directory name.

Sammo98 commented 6 months ago

Okay great thanks for confirming, I'll try to get a PR up today with these changes in place:

Screenshot 2024-01-09 at 13 24 09
mfirhas commented 3 weeks ago

Hi @pascalkuthe , What's the status of this issue?,

I know that helix has distinction between workspace and current working directory. Sometime I confuse which directory Im currently in. Other status info only show up to only files/dirs right under that pwd. So this current working directory status information would be useful to tell us, especially if we cd into another directories.

or, another status info would be great to tell us about current workspace, or current working directory relative to nearest workspace.

Check this PR as this is using the already written lib for cwd: https://github.com/helix-editor/helix/pull/10998

Sammo98 commented 3 weeks ago

Check this PR as this is using the already written lib for cwd: #10998

How does this differ to #9291 ?

mfirhas commented 3 weeks ago

Check this PR as this is using the already written lib for cwd: #10998

How does this differ to #9291 ?

I use helix_stdx::env::current_working_dir()