jpalardy / vim-slime

A vim plugin to give you some slime. (Emacs)
http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/
MIT License
1.89k stars 227 forks source link

Run vimscript commands interactively #405

Closed dam9000 closed 12 months ago

dam9000 commented 12 months ago

Can this be used or extended to run regular vim commands interactively?

jpalardy commented 12 months ago

Hi @dam9000

What do you have in mind?

If you "self-target", you can send vim some commands … although I've never tried it myself 🤔

dam9000 commented 12 months ago

One window where I could type vim commands, such as

:echo "hello"
:set rtp?
:hi Normal

and in the other window the output of these commands. Or alternatively getting the output in the same window, but a separate window for output probably makes more sense. But the execution would happen only for selected lines, not whole buffer (as in :so %)

Currently if one wants to edit or copy from command history it's rather cumbersome - <esc>:<ctrl-f>edit/copy<ctrl-c><ctrl-c> And one needs to check :messages to see the output which is not editable, searchable.

One alternative I found is the :Bufferize command plugin which solves half the problem, it outputs the command to a new buffer, which is nice for a single command, but not practical if you have more lines...

jpalardy commented 12 months ago

I tried a few things

I can drive a vim from another tmux pane:

Screen Shot 2023-12-03 at 14 03 54

(meaning: tmux with a split window, 2 vims, left vim slimes to the pane on the right)

I don't know if that's enough for your use-case

dam9000 commented 12 months ago

Ha interesting, now quite what I had in mind, but I guess that might be good enough, thanks for the tip.

dam9000 commented 12 months ago

I think the issue can be closed, thanks for the help.