Open poga opened 3 years ago
I've been thinking about it for a while, but I couldn't come up with a much better solution. You say there's a delay between the evaluation complete and the replace. Does it mean that the result is printed in the status line much before the text is replaced? That's strange because as I see you execute the paste right after the result is echoed.
Could you please tell me more about the rationale behind this eval_and_replace function? To be honest I don't really like the idea of combining the 'yank' and 'paste' together (or I just simply don't see the use case here). I can understand that it would be nice to have a feature that yanks the evaluation result into the register of choice, and the use may do whatever he/she wants to do with it later or (e.g. also pasting it over the original form). So I could more imagine and eval_and_yank feature instead of eval_and_replace. What do you think?
Oh, and sorry for the late answer, I was quite busy this week.
Don't worry. Thanks for the great software! I can't imagine working with lisp in vim without this amazing plugin. :D
SlimvEvalDefunAndReplace
and the text is actually being replaced. After some digging, I found that the delay is mostly due to slimv
polls results from swank. The delay is gone after adding let g:slimv_updatetime = 10
to my vimrc
.
(defun ยท (title)
`(โ ,title)
)
(defun โ (title)
`(ยท ,title)
)
So, if I type
(ยท "buy milk")
and call SlimvEvalDefunAndReplace
, It will becomes
(โ "buy milk")
Therefore, I can quickly track todos in my lisp session and keeps a list of current state in the source code.
eval_and_yank
is definitely great! I agree it's much better to keep yank
and paste
apart.
For example, I have a form
After evaluation, I want it to become:
How do I achieve it with slimv?
I have a working prototype at https://github.com/poga/slimv. It exposes two new function
SlimvEvalDefunAndReplace
andSlimvEvalDefunAndReplace
.It kinda worked. However there's some limit to it (mostly because I'm completely new to vimscript):
r
. I'm not using the register anyway but it's definitely not ideal.My question is: Is there a better way to do this? I'm willing to contribute if you're fine with this feature. Any guidance is appreciated ๐