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

Ability to use $file and $pwd in shell commands and formatter args #3642

Closed

Conversation

AlexanderBrevig
Copy link
Contributor

@AlexanderBrevig AlexanderBrevig commented Sep 1, 2022

This is a work in progress, to satisfy my curiosity about a KISS way of going about it.

This will enable people to use $file and $pwd for insert-output and formatter command args (the latter is what prompted me to test this idea).

  • make use of Env in more places (all the shell interactions)
  • find issues and PRs to link to - I know there is pre-existing work on this
  • figure out if the declarative approach is OK, or if we want something a bit more "sticky"

@AlexanderBrevig
Copy link
Contributor Author

Alternative to #3393 , the other PR probably matches better but will be harder to reuse for things like LSP config?

@AlexanderBrevig AlexanderBrevig changed the title feat: insert-output: echo $file and formatter args $file Ability to use $file in shell commands and formatter args Sep 11, 2022
@AlexanderBrevig AlexanderBrevig marked this pull request as ready for review September 11, 2022 22:05
helix-view/src/document.rs Outdated Show resolved Hide resolved
helix-view/src/env.rs Outdated Show resolved Hide resolved
helix-view/src/env.rs Outdated Show resolved Hide resolved
helix-view/src/handlers/dap.rs Outdated Show resolved Hide resolved
helix-term/src/commands/typed.rs Outdated Show resolved Hide resolved
helix-term/src/commands.rs Outdated Show resolved Hide resolved
AlexanderBrevig and others added 8 commits September 12, 2022 11:03
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
@kirawi kirawi added A-helix-term Area: Helix term improvements S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 13, 2022
@AlexanderBrevig AlexanderBrevig changed the title Ability to use $file in shell commands and formatter args Ability to use $file and $pwd in shell commands and formatter args Sep 16, 2022
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, instead of string replacement, it may be more elegant to set the env on the command https://doc.rust-lang.org/std/process/struct.Command.html#method.env although I'm not sure if that might make configs non-cross-platform

helix-view/src/env.rs Outdated Show resolved Hide resolved
helix-view/src/env.rs Outdated Show resolved Hide resolved
@the-mikedavis
Copy link
Member

I'm not sure how I feel about this vs #3393-style (kakoune-like) variables. The kakoune-like variables don't look like unix environment variables which is a double edged sword - nice for Windows users but maybe less intuitive for unix users

@kirawi
Copy link
Member

kirawi commented Dec 30, 2022

Addresses #3642

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants