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

Add absolute file path command expansion value #12989

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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.

3 participants