Permalink
Browse files

custom evals and watches

  • Loading branch information...
1 parent b267c27 commit 1b56235e80b0dc55ef102cbc033d7609f362681e @cldwalker committed Feb 18, 2014
Showing with 14 additions and 1 deletion.
  1. +1 −0 .light_table/user.behaviors
  2. +13 −1 .light_table/user.keymap
@@ -21,6 +21,7 @@
;; <Space> is a leader key in normal mode
"<Space>b" ":ltexec behaviors.modify-user"
"<Space>c" ":ltexec clear-console"
+ "<Space>e" ":ltexec ltfiles.expand-current-inline-result"
"<Space>k" ":ltexec keymap.modify-user"
"<Space>p" ":ltexec plugin-manager.show"
"<Space>tc" ":ltexec toggle-console"
View
@@ -50,4 +50,16 @@
;; avoid going to out of the way keys for command bar
:filter-list.input { "ctrl-n" [(:filter-list.input.move-selection 1)]
- "ctrl-p" [(:filter-list.input.move-selection -1)]}}}
+ "ctrl-p" [(:filter-list.input.move-selection -1)]}
+
+ ;; thanks to https://github.com/jamii/lt-config/
+ :editor.clj {
+ "alt-p" [(:eval.custom "(with-out-str (clojure.pprint/write __SELECTION__ :suppress-namespaces false :dispatch clojure.pprint/code-dispatch))" {:result-type :inline :verbatim true})]
+ "alt-m" [(:eval.custom " (with-out-str (clojure.pprint/write (macroexpand-1 '__SELECTION__) :suppress-namespaces false :dispatch clojure.pprint/code-dispatch))" {:result-type :replace :verbatim true})]
+ "alt-b" [(:eval.custom "(with-out-str (time (do __SELECTION__)))" {:result-type :inline :verbatim true})]
+ "alt-P" [(:editor.watch.custom-watch-selection "(let [result (do __SELECTION__)] (prn __SELECTION*__ result) __|result|__ result)" {})]
+ "alt-t" [(:editor.watch.custom-watch-selection "(let [start (java.lang.System/nanoTime)
+ res (do __SELECTION__)]
+ __|(str (float (/ (- (java.lang.System/nanoTime) start) 1000000)) \" ms\")|__
+ res)" {:class "timed" :verbatim true})]}}
+ }

0 comments on commit 1b56235

Please sign in to comment.