This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-22
Channels
- # beginners (8)
- # boot (41)
- # cider (1)
- # cljsrn (2)
- # clojure (91)
- # clojure-dev (34)
- # clojure-gamedev (3)
- # clojure-germany (6)
- # clojure-greece (324)
- # clojure-japan (2)
- # clojure-miami (4)
- # clojure-nl (6)
- # clojure-quebec (3)
- # clojure-russia (26)
- # clojure-spec (50)
- # clojure-uk (19)
- # clojurescript (147)
- # core-async (5)
- # css (2)
- # cursive (15)
- # datascript (7)
- # datomic (6)
- # hoplon (1)
- # jobs (4)
- # lein-figwheel (17)
- # off-topic (4)
- # om (52)
- # om-next (10)
- # onyx (1)
- # planck (19)
- # proton (1)
- # re-frame (81)
- # reagent (61)
- # spacemacs (1)
- # specter (46)
- # spirituality-ethics (7)
- # untangled (7)
- # yada (17)
cider freebie: Sometimes I'll be working in a (defn f ...)
and want to eval (f ...)
, and it sucks navigating back and forth, so I wrote this for my emacs config. C-c C-v
evals the next sexp:
Any recommendations for improving it?
(defun cider-eval-next-sexp ()
;; useful where I'm working in `(defn f ...)` and want to evan the following `(f ...)`
(interactive)
(save-excursion
(setq go-up t)
(while go-up
(condition-case nil ; go forward-up as far as you can
(paredit-forward-up)
(error (setq go-up nil))))
(paredit-forward) ; go to the next sexp
(cider-eval-last-sexp) ;eval it
))
(define-key cider-mode-map (kbd "C-c C-v") nil) ; overwrite cider's use of C-c C-v
(global-set-key (kbd "C-c C-v") 'cider-eval-next-sexp)