This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-13
Channels
- # aleph (5)
- # beginners (92)
- # cider (37)
- # cljs-dev (38)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (50)
- # clojure-berlin (1)
- # clojure-canada (3)
- # clojure-dusseldorf (4)
- # clojure-france (1)
- # clojure-germany (1)
- # clojure-italy (7)
- # clojure-nl (21)
- # clojure-spec (2)
- # clojure-uk (106)
- # clojurescript (165)
- # code-reviews (1)
- # community-development (3)
- # cursive (5)
- # datomic (13)
- # editors (12)
- # emacs (3)
- # figwheel-main (141)
- # fulcro (28)
- # graphql (1)
- # immutant (1)
- # jobs (1)
- # jobs-discuss (5)
- # midje (8)
- # nrepl (3)
- # off-topic (28)
- # onyx (4)
- # re-frame (21)
- # reagent (70)
- # ring (2)
- # ring-swagger (9)
- # shadow-cljs (18)
- # spacemacs (6)
- # specter (23)
- # tools-deps (21)
I’m using Spacemacs/Cider in Evil mode and I’m wondering what commands I might use to quickly jump to the end parens from the closure i am currently in. For example when I need to add more code after a () but the end parens is buried in the closing ))))))))) of the defn.
@jeremy642 I'd also like to know if there is a built-in way to do this. What I do is to define a key U
for "up":
(evil-global-set-key 'normal "U" 'backward-up-list)
(evil-global-set-key 'visual "U" 'backward-up-list)
which focusses the opening parenthesis; then I use %
to switch to the matching closing parenthesis.(There's a "lisp mini state" (`SPC k`), but I don't like it at all for navigation.)
Just to see if I understand correctly, you want a command that changes:
(defn something [] (println |"ok"))
to
(defn something [] (println "ok"|))
?
Because in spacemacs I use ]
for that, I think it's that way by default
Wait, wrong shortcut.
]
moves your cursor to the next closing )
, ]
, }
or etc regardless of the form you're on. (let | [a 1])
will become (let [a 1|])
but )
does what you probably asked for: (let | [a 1])
will become (let [a 1]|)
@pesterhazy Found out that % will move you back and forth between the current parens in the sexp. So if I can bind my own way to move around the lists without going into lisp state that would be great. I also found out yesterday the lisp state commands for inserting a new sexp above and below the current sexp which is awesome but I might have to rebind too.
@andre.stylianos Were you replying to me? Mostly I was trying to figure out how to navigate around the lisp, jumping from an opening or inside an sexp to the end of the sexp so that I could insert another sexp below it.
Ah, sorry @jeremy642, seems like it's not default behavior but part of evil-cleverparens