Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pasting result of cpp into buffer #282

Open
nenadalm opened this issue Nov 16, 2016 · 4 comments
Open

Pasting result of cpp into buffer #282

nenadalm opened this issue Nov 16, 2016 · 4 comments

Comments

@nenadalm
Copy link

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?)

@styts
Copy link

styts commented Nov 17, 2016

Not sure if this helps, but there is already c!! which replaces a form with it's evaluated result.

@nenadalm
Copy link
Author

@styts thanks, but I would like to copy that result and paste it (without replacing).

@jeaye
Copy link

jeaye commented Dec 5, 2016

This is something I'd love to have as well.

@tpope
Copy link
Owner

tpope commented Jul 23, 2019

Is copying the result out of the :Last buffer good enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants