vim-fireplace
vim-fireplace copied to clipboard
Pasting result of cpp into buffer
Hi. What I thought about doing is to write some function (e.g. "do-something"), do some implementation, write test:
(deftest do-something-test
(is (= (do-something arg1 arg2)
evaluate call using cpp and if the result is ok, then paste it into the test so after paste it would look like:
(deftest do-something-test
(is (= (do-something arg1 arg2)
result
I am not very expirienced with vim, but I come up with this so far:
:nmap <leader>w :redir @b <bar> :exec "norm cpp" <bar> :redir END <bar> :exec 'let @b = substitute(@b, ".*No matching autocommands\n", "", "g")'<cr>
:nmap <leader>e :put b<cr>
so now I can evaluate form with \w and paste the result with \e. Is there a way to overwrite cpp so it would paste the result into some registry or something?
maybe this could even be in the plugin? (or doc as tip?)
Not sure if this helps, but there is already c!! which replaces a form with it's evaluated result.
@styts thanks, but I would like to copy that result and paste it (without replacing).
This is something I'd love to have as well.
Is copying the result out of the :Last buffer good enough?