Skip to content

Show current workspace with working directory in status line #11033

Open
@mfirhas

Description

@mfirhas

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions