Fork me on GitHub
#spacemacs
<
2018-06-06
>
joshkh07:06:30

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.

practicalli-johnny09:06:45

@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

👍 4
practicalli-johnny09:06:25

Lisp mode is specifically for structured editing with a normal state (i.e. not insert state)

practicalli-johnny09:06:31

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

practicalli-johnny09:06:04

I am assuming by edit mode you mean vim insert state, although the same select and wrap should also work in Emacs state

joshkh11:06:10

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?

joshkh11:06:42

as a complete newbie, what's the best way for me to mentally port my understanding of Cursive's structural editing and keybindings?

practicalli-johnny09:06:45

@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

👍 4
Bravi10:06:49

@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

n2o19:06:12

I really laughed when I saw your cursive Reaktion @ag 😉

ag20:06:35

well they don't have intellij emoji

ag20:06:07

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 cider like jumping to definition and find-usages that work reliably and for all: clj | cljs | cljc

ag20:06:12

single and reliable way to navigate to definitions of functions, keywords or any symbols at all

eggsyntax20:06:37

🤷 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).

n2o20:06:41

M-enter g g works quite well in cider

ag20:06:56

not really. does it work for keywords? does it work reliably in clojurescript files?

ag20:06:12

can it work without repl connection?

ag20:06:32

can you jump to a spec definition?

ag20:06:31

can you jump to a namespace file under cursor?

ag20:06:39

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

n2o20:06:49

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

spfeiffer20:06:35

@bravilogy I tried to reproduce your issue, but all works as expected. Using emacs 26.1 with spacemacs dev branch.

Bravi20:06:24

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

spfeiffer20:06:25

Yes, i believe you, but there must be other influencing factors.

Bravi08:06:43

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

ag20:06:08

I'm not saying cider 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 cursiveis getting ton of improvements lately and lots of people switching to it.

ag20:06:27

That makes me sad

ag20:06:08

Stop leaving Emacs, people!

n2o20:06:19

I am always a bit sad when clj-refactor or so says it only works with clj-files... Have to do it manually then...

eggsyntax20:06:43

^ clj-refactor for cljs is my #1 wish.

ag20:06:20

yeah... than #1 reason why I cry sometimes standing in my shower, rocking and sobbing cljs could use some cider love

😿 4
eggsyntax20:06:42

I retract that. CIDER debugger for cljs is my #1 wish 🙂

n2o20:06:54

oh jeah, that's right

ag20:06:32

well... can we first fix "jump-to-definition" and "find-usages"?

eggsyntax20:06:57

@ag I'm still using your improved jump-to-def, and have been happy as a clam 😄

ag20:06:57

but... but it still sucks