Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

custom evals and watches

  • Loading branch information...
commit 1b56235e80b0dc55ef102cbc033d7609f362681e 1 parent b267c27
@cldwalker authored
Showing with 14 additions and 1 deletion.
  1. +1 −0  .light_table/user.behaviors
  2. +13 −1 .light_table/user.keymap
View
1  .light_table/user.behaviors
@@ -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
14 .light_table/user.keymap
@@ -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})]}}
+ }
Please sign in to comment.
Something went wrong with that request. Please try again.