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 current workspace with working directory in status line #11033

Open
mfirhas opened this issue Jun 25, 2024 · 0 comments
Open

Show current workspace with working directory in status line #11033

mfirhas opened this issue Jun 25, 2024 · 0 comments
Labels
C-enhancement Category: Improvements

Comments

@mfirhas
Copy link

mfirhas commented Jun 25, 2024

Continuing from issue: #8966

Helix has workspace(space-f) and working directory(space-F).

It's good to show those information in status line so we're aware of where we're at, at what workspace(.git) and working directory.

This how it should looks like in status line:

workspace-base-dir/working-directory/sub-working-directory

Im confused when opening multiple projects in multiple tabs with helix, in each of them I switched directories and just confused as file picker doesn't give information of the current root directory, nor file-name config as it started from right under that workspace/working directory.

The rules:

  • When we open helix on a file, it behave just like the original, the workspace is the current pwd.
  • When we open helix on a directory:
    • if the directory contains .git, the status line will print the base of that directory.
      e.g: hx /Users/theuser/projects/project-a, status line will print project-a as it contains .git(workspace)
    • if the directory contains no .git, the status line will print closest parent dirs with .git, followed by paths till the directory(pwd)
      e.g. hx /Users/theuser/projects/project-a/sub1/sub2/, status line will print project-a/sub1/sub2, so the most left is workspace(space-f), most right is the pwd(space-F).
  • When we cd to upper directories, workspace status will update to that directory whether it contains .git or not
  • When we cd to lower directory
    • if it contains .git, update the workspace status to that directory.
    • if it contains no .git, append the new working directories after workspace.
  • Append only happen when transitioning from upper workspace directories to lower non-workspace directories.

It's good to combine it with file-name config, as it shows paths right under current workspace/working directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

1 participant