-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Enhancement: make a running helix instance open a file by path #6054
Comments
To add to this, it would be nice if the option / flag would let you specify to open a new instance of helix if no instance is found and to open the file inside an existing instance if one is found. One design issue that'd need to be figured out is that sometimes there might be multiple instances of helix. |
Duplicate of #2177 |
hey both, please thumbs up that issue and share your input over there 😃 |
I know that you may already be using the file explorer from #5768 but I still want to share how I integrated First, create a #!/usr/bin/env sh
fpath="$1"
pane_id=$(wezterm cli get-pane-direction right)
if [ -z "${pane_id}" ]; then
pane_id=$(wezterm cli split-pane --right --percent 80)
fi
program=$(wezterm cli list | awk -v pane_id="$pane_id" '$3==pane_id { print $6 }')
if [ "$program" = "hx" ]; then
echo ":open ${fpath}\r" | wezterm cli send-text --pane-id $pane_id --no-paste
else
echo "hx ${fpath}" | wezterm cli send-text --pane-id $pane_id --no-paste
fi
wezterm cli activate-pane-direction --pane-id $pane_id right Next, call it as a custom opener: $ export NNN_OPENER=nnn-hx.sh
$ nnn -c This integration allows you to use |
This is a python script I use for autokey that opens a file selected in ranger, assuming the helix lives in the last accessed tmux window. keyboard.send_key("y")
time.sleep(0.1)
keyboard.send_key("p")
time.sleep(0.1)
keyboard.send_keys("<ctrl>+b")
keyboard.send_keys("l")
keyboard.send_keys("<escape>")
time.sleep(0.1)
keyboard.send_keys(":open <ctrl>+r*")
keyboard.press_key("<code36>")
keyboard.release_key("<code36>") Note: Those small delays are required for me to prevent previous keypres being eaten. |
Right now there is no file tree (#200) within helix, but there are plenty of file tree programs like
nnn
,lf
,ranger
, etc. There are also terminal composers/multiplexers likezellij
that have the opportunity to launchhx
, then on keybinding show an instance ofnnn
, take the picked result, and pass the path to the contained instance ofhx
to have it open that fileHowever, as it stands, I don't believe there is a way to ask an existing instance of
hx
to open a file by pathOriginally posted in this comment: #200 (comment)
The text was updated successfully, but these errors were encountered: