interacting with REPLs #7735
Unanswered
JurajLieskovsky
asked this question in
General
Replies: 1 comment 1 reply
-
I use Kitty and Helix like this, what do you think? [keys.normal.space]
c = { r = ":sh kitty @ send-text --match 'title:^Terminal' cargo run \\\\n", t = ":sh kitty @ send-text --match 'title:^Terminal' 'clear \\ncargo test \\n'" }
z = [":pipe sgpt --code --no-cache 'Replace this code with a better version and complete it.'"]
Z = [":pipe-to cat > /tmp/helix-gpt", ":append-output cat /tmp/helix-gpt | sgpt --code --no-cache 'Finish this code. Start typing from where I left.'"] I also made this: https://github.com/David-Else/kitty-terminal-project-launcher |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, before switching to helix I used Sublime Text for a couple of years where I really liked the plugin SendCode which I used to send commands to a REPL (usually Julia) opened in an independent window. As I was preparing to switch to Wayland where xdotool (used by the plugin) does not have an analog, I started searching for an alternative way of performing similar actions.
What came up with, was using remote control of kitty a cross-platform terminal that can be used even better with helix.
If I have helix opened in an instance of kitty, I can open a new terminal window after sending helix to the background (
ctrl-z
) for a second:. In the new terminal, I then open a REPL to which I can send lines of code using the ':pipe-to' command:
directly from the editor in the original terminal (using
fg
to bring it back). One thing that is pretty cool is that I can also use theexpand_selection
command to select whole functions, structs, etc. before sending them to the REPL.The only issue I have is how to efficiently call the
:pipe-to ...
command repeatedly. I know it lives in the:
register, but I'm not sure if I can efficiently move it to a more permanent register and then recall it.Ideally one would make a plugin where even the new terminal would be called by some alias in helix with its name stored in some project file, afaik plugins are not really a thing in helix atm.
So if anyone has a suggestion on how I could improve the workflow, I am all ears.
Beta Was this translation helpful? Give feedback.
All reactions