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

Feature Request: add more useful variables for shell/spawn commands #541

Open
as3ii opened this issue May 19, 2024 · 1 comment
Open

Feature Request: add more useful variables for shell/spawn commands #541

as3ii opened this issue May 19, 2024 · 1 comment

Comments

@as3ii
Copy link

as3ii commented May 19, 2024

it can be useful to have more variables accessible while composing a command with :shell and :spawn (particularly in keymap.toml. Below is an example that would satisfy one of my use cases:

:spawn alacritty --working-directory "%f" -e joshuto

Or :spawn alacritty -e joshuto "%f" where %f (random letter) is replaced with the path of the current directory.

Other useful variables can be $SHELL and $EDITOR to compose commands without invoking external scripts or hardcoding which is the preferred shell or editor (for example).

Workarounds/suggestions are welcome (shell scripts aside)

@as3ii
Copy link
Author

as3ii commented May 19, 2024

in joshuto 0.9.8 something like this don't work (joshuto crash):

:shell a="%s"; alacritty --working-directory "${a%/*}"

and in the following the string %s is not substituted correctly:

:shell bash -c "a=%s; alacritty --working-directory ${a%/*}"

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

No branches or pull requests

1 participant