Skip to content

Conversation

@thomasschafer
Copy link
Contributor

It's often useful to get the full path to the file in the current buffer. This PR adds a variable file_path_absolute which is expanded to the full path to the currently focused document, or the current working directory if that is not available e.g. in scratch buffers.

@thomasschafer thomasschafer force-pushed the tschafer-add-absolute-file-path-command-expansion branch from ab48afd to 3a30eb5 Compare February 28, 2025 13:20
@the-mikedavis
Copy link
Member

Can't this be done with realpath %{buffer_name} instead?

@thomasschafer
Copy link
Contributor Author

Can't this be done with realpath %{buffer_name} instead?

The only difference is that this command defaults to the cwd in a scratch buffer, whereas realpath [scratch] errors, and I guess this variant is a little more ergonomic than $(realpath %{buffer_name}). Happy to close though if those aren't considered issues

@kpbaks
Copy link
Contributor

kpbaks commented Mar 1, 2025

realpath is a part of GNU coreutils. So having this built in would be more portable for people using helix under Windows.

@SymphonySimper
Copy link
Contributor

SymphonySimper commented Oct 21, 2025

Sorry to disturb, but is there any chance of this getting merged?

It also helps with lsp-workspace-command: #14499 (comment)

@the-mikedavis the-mikedavis merged commit f828de3 into helix-editor:master Nov 11, 2025
6 checks passed
alschena pushed a commit to alschena/helix that referenced this pull request Nov 13, 2025
kfatyuip pushed a commit to kfatyuip/helix that referenced this pull request Nov 21, 2025
rcharre pushed a commit to rcharre/helix that referenced this pull request Dec 28, 2025
a3lem pushed a commit to a3lem/helix that referenced this pull request Jan 11, 2026
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

Successfully merging this pull request may close these issues.

4 participants