tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.75k stars 139 forks source link

inconsistent cpp docs #148

Closed acthp closed 10 years ago

acthp commented 10 years ago

The project markdown says cpp evaluates the outermost form. The docs file says it evaluates the innermost form.

https://github.com/tpope/vim-fireplace#evaluating-from-the-buffer

https://github.com/tpope/vim-fireplace/blob/master/doc/fireplace.txt#L154

acthp commented 10 years ago

Seems to actually do innermost. Outermost would be very useful, too.

tpope commented 10 years ago

When it was innermost, people complained. When it was outermost, people complained.

acthp commented 10 years ago

Why not both?

tpope commented 10 years ago

See #91.

tpope commented 10 years ago

And #119.

acthp commented 10 years ago

If there's a working outermost eval in those issues, I missed it. Closest is cpip, but it doesn't really work. It only works if there's a blank line after the form. E.g. in this position, it evals to 5:

(+ |1 2)
(+ 2 3)
tpope commented 10 years ago

Use a plugin with an appropriate text object, such as vim-sexp, and be aware it's not nearly as useful as you imagine.

acthp commented 10 years ago

Cool, thanks.

I currently do this all the time the annoying way, with cp%, so not sure why it wouldn't be useful. I saw Brandon's comment about cpr, but cpr requires writing to disk, which often is not an option.