This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-06
Channels
- # beginners (137)
- # cider (60)
- # cljs-dev (52)
- # cljsrn (5)
- # clojars (15)
- # clojure (156)
- # clojure-brasil (1)
- # clojure-dev (7)
- # clojure-italy (13)
- # clojure-serbia (2)
- # clojure-spec (12)
- # clojure-uk (76)
- # clojurescript (129)
- # core-async (27)
- # core-typed (1)
- # cursive (3)
- # datomic (105)
- # devcards (39)
- # emacs (10)
- # figwheel (1)
- # fulcro (68)
- # graphql (6)
- # juxt (3)
- # klipse (85)
- # lein-figwheel (47)
- # leiningen (3)
- # midje (1)
- # mount (26)
- # off-topic (71)
- # om (4)
- # overtone (4)
- # parinfer (3)
- # pedestal (4)
- # portkey (37)
- # re-frame (37)
- # reagent (13)
- # reitit (3)
- # ring (1)
- # rum (5)
- # shadow-cljs (191)
- # spacemacs (35)
- # specter (26)
- # tools-deps (45)
- # vim (20)
how does one go about using paredit keybindings in edit mode? for instance wrapping an expression in parens? M-( doesn't seem to do the trick.
@joshkh Although the paredit package is included in the Clojure layer, the keybindings are not defined. You can use Smartparens (which is maintained, unlike paredit) and use strick mode for the basics of paredit. There are also equivalent smartparens functions to those in paredit, which work for all programming languages. Suggest you take a look at lisp mode SPC k
Lisp mode is specifically for structured editing with a normal state (i.e. not insert state)
If you just want to wrap in edit mode, then select with C-SPC and move select the region to wrap, then press the opening parens
I am assuming by edit mode you mean vim insert state, although the same select and wrap should also work in Emacs state
thanks! and yup, i meant insert state (i'm very new to emacs). i found the structural editing functions but dropping in and out of insert mode just to slurp / barf seems like a lot of work. in Cursive i would normally press C+W to expand a selection to surrounding forms, press C+' to raise a form, etc. is there also an equivalent key binding to expand a selection?
as a complete newbie, what's the best way for me to mentally port my understanding of Cursive's structural editing and keybindings?
@joshkh Although the paredit package is included in the Clojure layer, the keybindings are not defined. You can use Smartparens (which is maintained, unlike paredit) and use strick mode for the basics of paredit. There are also equivalent smartparens functions to those in paredit, which work for all programming languages. Suggest you take a look at lisp mode SPC k
@jeff.terrell hi again 🙂 I was wondering, if you get a chance, could you also drop a quick comment on here please? https://github.com/syl20bnr/spacemacs/issues/10811
Cursive is good. Sadly I have to admit I think it's too good. I feel bad we still haven't figured out basic stuff in like jumping to definition and find-usages that work reliably and for all: clj | cljs | cljc
single and reliable way to navigate to definitions of functions, keywords or any symbols at all
🤷 on the other hand, SM/emacs/CIDER is about a milion times more customizable, and much lighter-weight. Those both matter to a substantial # of folks, I think. Certainly they do to me. And of course free is always pleasant, although I don't mind paying for good tools (& in fact have bought -- via work -- a Cursive license, which use every once in a while for project-analysis stuff).
you see? things kinda work. there and there you often get some quirks you have to deal with. But this is basic stuff that a developer needs
okay, haven't tested it on Keywords, usually I jump to fn definitions. Most of my time I am working with cljs and have always a REPL running
@bravilogy I tried to reproduce your issue, but all works as expected. Using emacs 26.1 with spacemacs dev branch.
I will record my screen and post a little gif. it could be something about the lines around it. it is not happening on some lines of code and its happening on others. So later on I will post the gif to show it
Yeah, definitely. And I’m trying to determine what they are. 😄 Here’s the gif https://cl.ly/3H0P123N3P1F And another strange thing about that is - in those macros I didn’t put a new line anywhere and yet it automatically puts a new line. This is the keyboard sequence I used there in both cases:
qq i fo SPC ESC q @q
I'm not saying is not hands down the best option for programming in Clojure. It's the best. But it has tons of things that need to be improved. Other choices are simply just not as good. And is getting ton of improvements lately and lots of people switching to it.
I am always a bit sad when clj-refactor or so says it only works with clj-files... Have to do it manually then...