sydney.lambda
2019-6-25 19:00:49

@hunter Hi Hunter, I’m not sure if this is what you were looking for but I just have F5 mapped to: nnoremap <F5> :w<CR>:!clear<CR>:!racket %<CR> There’s a plugin called tslime: https://github.com/jgdavey/tslime.vim Which you can use to send text (often selected using visual mode) into a tmux buffer, which would be running racket. I’m not terribly well-versed in hotloading (it’s called that, I think) of code, but perhaps something like: • Open the tmux session and start racket • Send the entire file to the session (you could use require/enter for this using the racket terminal, but as you’re going to presumably be redefining things a lot it seems somewhat pointless) • When you want to test something out, send the code using tslime to the buffer which will run and give you a result. Unless there’s some way to automatically have Racket re-require any files that have been updated so you can just use tslime as a way of sending pieces of code you wish to test out. I believe there’s a dynamic re-require of some sort, but I don’t think it actually checks and does that on the fly, though I could of course be completely wrong on this.


sydney.lambda
2019-6-25 19:01:53

I’d been meaning to put the effort into setting up a decent tmux workflow myself, but now that vim has native terminal support, I dare say that is the better option as it cuts out the “middle-man” of tmux. Hope this helps somewhat. Please let me know how things go :slightly_smiling_face: I’ve been meaning to try this out myself instead of just running the entire file using F5.


sydney.lambda
2019-6-25 19:15:33

As an aside, if you’re not already using it there’s a vim-racket plugin which adds some pretty good syntax highlighting and indenting. It’s not perfect, sometimes messing up indentation of (for/_) forms, but in general it’s nice.


hunter
2019-6-25 19:25:44

@sydney.lambda thank you!


hunter
2019-6-25 19:26:16

I’m using vim-racket with parinfer and it’s working well, I’m not a tmux user but it might be worth becoming one if this is the way to do it. I’ll check this out, thank you much!


sydney.lambda
2019-6-25 19:47:21

You’re welcome :slightly_smiling_face: Can’t believe I forget to mention this: I highly recommend vim sexp (https://github.com/guns/vim-sexp) in conjuction with the mappings-for-normal-people (https://github.com/tpope/vim-sexp-mappings-for-regular-people) which replaces some bindings in sexp that require the use of Alt as a modifier.


sydney.lambda
2019-6-25 19:49:10

I’m not sure I could explain how they work and do them justice, but I’ve used them so long now I’d be lost for sure without them. You can treat groups of parenthesised expressions as vim text objects, slurp and barf parentheses, and lots of other useful things which make editing lisp code so much more efficient and intuitive. And there’s vim niji (https://github.com/losingkeys/vim-niji) if you don’t already have a rainbow-parens plugin.


gfb
2019-6-26 03:27:47

@me1531 big-bang is syntax wrapping world% #lang racket (require 2htdp/private/world 2htdp/image) (send (new world% [world0 #true] [display-mode 'normal] [close-on-stop #false] [record? #false] [name #false] [state #false] [register #false] [port 4567] [check-with (λ _ #true)] [on-key #false] [on-release #false] [on-pad #false] [on-mouse #false] [on-receive #false] [on-draw (λ _ (star 50 "solid" "blue"))] [stop-when (list (λ _ #false) void)]) last) You could subclass world% : augment create-frame/universe to get a handle on the frame, possibly override deal-with-key to specifically enrich the key handling.