Closed KGOH closed 7 months ago
Here are my neovintageous bindings, I use
"noremap FileType clj,cljs,cljc,bb,edn ,ep :ClojureSublimedEvalWithWrap wrap_fstr='(as-> %s $ (do (require [(symbol "clojure.pprint")]) (require [(symbol "clojure.java.io")]) (clojure.pprint/pprint $ (clojure.java.io/writer "/tmp/sublimed_output.edn")) $))'\|:OpenFile file='/tmp/sublimed_output.edn'<CR>
noremap FileType clj,cljs,cljc,bb,edn ,ep :ClojureSublimedEvalWithWrap wrap_fstr='(as-> %s $ (do (require [(symbol "fipp.edn")]) (require [(symbol "clojure.java.io")]) (fipp.edn/pprint $ {:writer (clojure.java.io/writer "/tmp/sublimed_output.edn")}) $))'\|:OpenFile file='/tmp/sublimed_output.edn'<CR>
noremap FileType clj,cljs,cljc,bb,edn ,ef :ClojureSublimedEvalWithWrap wrap_fstr='(as-> %s $ (do (require [(symbol "clojure.java.io")]) (with-open [w (clojure.java.io/writer "/tmp/sublimed_output.edn")] (binding [*print-length* nil *out* w] (pr $))) $))'\|:OpenFile file='/tmp/sublimed_output.edn'<CR>
This satisfies the #101 requirements. The implementation adds optional argument
wrap_fstr
to theClojureSublimedEval
command.wrap_fstr
should be a format string for the%
operatorExample usage:
I have tested this update with the socket repl connection and the raw nREPL. All other ones should reuse the same logic as the raw nREPL. The original behavior of the
ClojureSublimedEval
is left as is by default, the update is backwards compatible