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

Tmux Replify #108

Open
jaidetree opened this issue Aug 29, 2021 · 4 comments
Open

Tmux Replify #108

jaidetree opened this issue Aug 29, 2021 · 4 comments
Labels
community-feedback We would like your feedback to help improve this feature. someday

Comments

@jaidetree
Copy link
Collaborator

jaidetree commented Aug 29, 2021

Came up with a personal mod to get selected text, display a tmux session selector GUI, then send the text to the selected tmux session. In essence, you can have a repl-driven-workflow just about anywhere.

2021-08-29 12 56 48

@jaidetree
Copy link
Collaborator Author

Would anyone be interested in such a feature?

@jaidetree jaidetree added community-feedback We would like your feedback to help improve this feature. someday labels Aug 29, 2021
@jaidetree
Copy link
Collaborator Author

It just hit me this could be used to facilitate a fennel->spacehammer repl experience:

2021-08-29 14 36 58

  • my ~/.spacehammer/config.fnl is running @Grazfather's repl server script from Add basic REPL support. #93
  • using nodemon to watch my ~/.spacehammer//* and ~/.hammerspoon//* for .fnl files and run ./fennel shevek 7888
  • Can press hyper-t to send selected text in emacs to tmux selection (prompts using the chooser GUI if none selected)
  • If I save a .fnl file nodemon will wait for spacehammer to reloads, then restarts the shevek nrepl client

Rough Edges

  • When spacehammer reloads, hyper-t will prompt to select tmux session again. Could either cache selection in a file or using a hs api if there's one for that. Or I could create a new shortcut that always targets a specfic spoon session name and window
  • It's kind of annoying to select text before sending to the REPL so a separate, more targeted command like hyper-c is created for this purpose, then it could send keys to select the nearest outer form like the eval defun forms

This is a somewhat crude setup spanning a few languages, but it's the most viable path I've found so far.

@Grazfather
Copy link
Collaborator

I like this

When spacehammer reloads, hyper-t will prompt to select tmux session again. Could either cache selection in a file or using a hs api if there's one for that. Or I could create a new shortcut that always targets a specfic spoon session name and window.

You could leave this to the person who sets it up. Maybe they provide a selector function that, if it returns nil, falls back to the hs.chooser. Their selector might use some state file of their choosing, or maybe just hardcodes a window/pane that they always dedicate for this sort of thing.

@jaidetree
Copy link
Collaborator Author

I like this

When spacehammer reloads, hyper-t will prompt to select tmux session again. Could either cache selection in a file or using a hs api if there's one for that. Or I could create a new shortcut that always targets a specfic spoon session name and window.

You could leave this to the person who sets it up. Maybe they provide a selector function that, if it returns nil, falls back to the hs.chooser. Their selector might use some state file of their choosing, or maybe just hardcodes a window/pane that they always dedicate for this sort of thing.

That sounds like another perfect use case for #107 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-feedback We would like your feedback to help improve this feature. someday
Projects
None yet
Development

No branches or pull requests

2 participants