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

feat: add workspace_directory and current_working_directory variable expansions #13068

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nik-rev
Copy link
Contributor

@nik-rev nik-rev commented Mar 10, 2025

Use case: Recently Yazi added out-of-the-box support for usage inside of Helix with with command:

[keys.normal]
space.E = [
  ':sh rm -f /tmp/unique-file',
  ':insert-output yazi %{buffer_name} --chooser-file=/tmp/unique-file',
  ':insert-output echo "\x1b[?1049h" > /dev/tty',
  ':open %sh{cat /tmp/unique-file}',
  ':redraw',
]

This replaces file_explorer_in_current_buffer_directory for me with a Yazi picker

I would like to be able to replace these two commands with Yazi as well:

  • file_explorer (uses workspace root)
  • file_explorer_in_current_directory (cwd)

This PR allows for that. Now you can do this too:

# file_explorer
space.e = [
  ':sh rm -f /tmp/unique-file2',
  ':insert-output yazi %{workspace_directory} --chooser-file=/tmp/unique-file2',
  ':insert-output echo "\x1b[?1049h" > /dev/tty',
  ':open %sh{cat /tmp/unique-file2}',
  ':redraw',
]
# file_explorer_in_current_working_dir
space.X = [
  ':sh rm -f /tmp/unique-file3',
  ':insert-output yazi %{workspace_directory} --chooser-file=/tmp/unique-file3',
  ':insert-output echo "\x1b[?1049h" > /dev/tty',
  ':open %sh{cat /tmp/unique-file3}',
  ':redraw',
]

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.

1 participant