3 ms·
>simply use the send-keys command to execute the selected code (or line) instantly in pane 1. Sorry, I don't get it. How can you only run selected code or line
by FirmwareBurner 3y ago
>simply use the send-keys command to execute the selected code (or line) instantly in pane 1.
Sorry, I don't get it. How can you only run selected code or lines individually without the full context of the program/project that code is part of?
- wcrossbow 3y agoThis style of doing things is very common in languages with a (good) REPL, think clojure or ipython. You keep sending snippets and iterating on them until they work as intended. For that, you don't need the full context of your program. Not a LISPer but apparently in that land you could actually have the program running and a REPL attached to it, in which case, you actually do have all the program at your disposal.
- vladvasiliu 3y agoThe only nice REPL I have experience with is ipython. And even a few years ago, just turning on autoreload allowed me to do that without selecting anything and copying / pasting, just edit the function in the editor and run it again. IIRC the docs said there were some edge cases, but I never ran into those.
- crabbone 3y agoWhy do people keep repeating it... Python doesn't have a REPL. It has an interactive shell. Read-eval-print-loop relies on being able to feed what you print back to the read function. Interactive shell doesn't need the ability to print code: it prints whatever information a function wants to print (often times nothing). In Python sometimes you can feed back the results of a function into some other function (when you are in the interactive shell), but usually they are nothing like Python code...
- buf 3y agoHere is a super basic example of running rails code: https://cln.sh/xXNlf51m https://cln.sh/xXNlf51m Now imagine instead of a empty rails shell, I had my server running there and I can set breakpoints. Or why not both a shell and a server?
- pawelduda 3y agoStealing this. I'm using send-keys to run specific test examples under my cursor (sends test_command current_file_path:current_line_num)
- xdennis 3y agoHow is that done? I'm using this to send what's copied into the clipboard to the other target: bind r run 'xsel -bo | tmux load-buffer -; tmux paste-buffer -t .+'
- theappsecguy 3y agoAny chance your configs are on a repo somewhere?! For rails vim and for this tonic setup (if there’s even configs needed for that)
- bdavbdav 3y agoThink of a REPL or shell (which I guess is a REPL…). Same thing you might do in a Jupyter NB.
- ilyt 3y agoI'd imagine he's talking about language with REPL