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

pretty print results #262

Closed mgrubb closed 5 years ago

mgrubb commented 8 years ago

It would be nice to be able to either set an option or get separate keybinds for cpp and c!! to use pretty printed format. This would make using clojure code to refactor existing code nicer.

tpope commented 8 years ago

Doesn't cider-nrepl have some sort of support for this? Can we tap into it?

mgrubb commented 8 years ago

There is a cider.nrepl.middleware.pprint/wrap-pprint middleware that will return a :pprint-out key in the response if the the :eval message is sent with the :pprint key set to 1. See https://github.com/clojure-emacs/cider-nrepl#supplied-nrepl-middleware https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/pprint.clj#L99

Though in doing some more thinking about this, it might be more useful to have the general ability to create a mapping to send/modify a nrepl message with the same semantics of cpp or c!! etal.

tpope commented 8 years ago

I think it would be fine to make this the default behavior for cpp. Maybe c!! too if you can get the indenting correct.

devth commented 7 years ago

@mgrubb did you ever impl anything on this? pprint would be awesome.

Deraen commented 5 years ago

This has been implemented and can be closed.