The home of Mikael Jansson, hacker, hobby chef & adrenaline junkie based in Sweden. More…

Mikael Jansson.be » Hacking

Ticket #11 (accepted enhancement)

Opened 2 years ago

Last modified 2 years ago

Previewing lisp machine state in vim buffer for splits

Reported by: dan@… Owned by: mikael
Priority: minor Milestone: 1.0
Component: lisp mode Version: 0.3.3
Keywords: Cc:

Description

I'm decidedly NOT a vim or Lisp expert, but this is some cool integration you've got going on. It seems like it could be taken a step further.

What would be REALLY nice is a method for dumping the lisp machine's current output back into an (optional) vim buffer, so that the F12 toggle would only be necessary for actually typing directly into the lisp machine.

After a brief look at bridge.vim, I'm not sure exactly where this would happen; maybe in LimpBridge_send_to_lisp? I'm imagining it could work like this:

Any time the bridge sends something to the buffer via screen -x, it then does a

screen -x eval "hardcopy .some_temp_file_with_screenid"

and then (if necessary) reads that content back into a readonly buffer.

(Also, I don't know if you care, but your dates are wrong in bridge.vim -- 2008-08-26 looks like you can back from the future ;)

Change History

Changed 2 years ago by mikael

  • owner set to mikael
  • status changed from new to accepted

Why yes, I have a DeLorean in the garage and a flux capacitor on my desk!

It's a nice idea. It could be further improved by diffing against the last hardcopy and just passing on that which has changed since last time. However, there's a problem of not knowing if the command you last sent is finished. You couldn't just make a hardcopy directly after. Any ideas?

Changed 2 years ago by mikael

  • version changed from 0.3.2 to 0.3.3

Changed 2 years ago by mikael

  • milestone set to 1.0

Changed 2 years ago by dan@…

Heh. I see what you mean.

I could get the same sort of result by nesting the hidden screen session inside a "main" screen session, and then just split the top-level screen to vim and the hidden screen.

Changed 2 years ago by dan@…

It seems like the "right" way to do it would be to trigger a hardcopy when the screen activity bell goes off and let vim automatically load the changes, but I don't think screen supports running arbitrary commands like that.

Oh, and there's this kind of hack: vimtip 616 ... But I've tried that in the past for a similar process and it didn't work too well.

Another possible (bad idea?) hack would to be just log or tee the entire lisp output to somewhere, and have a vim buffer open on that which is hacked to do a :visual G every time it auto-loads. It's really more of a preview window, but I can see it maybe being useful to run Limp commands in sub-forms inside it...

All this aside, Limp kicks booty.

Changed 2 years ago by mikael

Which brings us to milestone:1.0 -- what this ticket boils down to is a way to communicate with the Lisp, and that's easiest done with SWANK on the Lisp side and a SLIME-reimplementation on the Vim side.

Patches accepted!

Note: See TracTickets for help on using tickets.
'