Skip to content
Browse files

moar custom eval, watch + behavior tweaks

  • Loading branch information...
1 parent 1b56235 commit b65ab19e4e2da9dbb31ccb1dd283a6643ec1644d @cldwalker committed Feb 18, 2014
Showing with 7 additions and 6 deletions.
  1. +1 −2 .light_table/user.behaviors
  2. +6 −4 .light_table/user.keymap
View
3 .light_table/user.behaviors
@@ -13,18 +13,17 @@
;; The app tag is kind of like global scope. You assign behaviors that affect
;; all of Light Table here
:app [(:lt.objs.style/set-skin "dark")
- (:lt.objs.plugins/load-js "recall.js" true)
(:lt.plugins.vim/map-keys {"-" "$",
"0" "^",
"j" "gj",
"k" "gk"
;; <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"
+ "<Space>ti" ":ltexec ltfiles.toggle-current-inline-result"
"<Space>tl" ":ltexec ltfiles.toggle-line-numbers"
"<Space>tw" ":ltexec ltfiles.toggle-strip-whitespace"
"<Space>v" ":ltexec tabset.new"
View
10 .light_table/user.keymap
@@ -53,11 +53,13 @@
"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})]
+ :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 :inline :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-r" [(:eval.custom "(clojure.test/run-tests)" {:result-type :statusbar})]
+ "alt-shift-b" [(:eval.custom "(do (require '[criterium.core]) (with-out-str (criterium.core/bench (do __SELECTION__))))" {:result-type :inline :verbatim true})]
+ ;; watches
+ "alt-shift-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\")|__

0 comments on commit b65ab19

Please sign in to comment.
Something went wrong with that request. Please try again.