Fork me on GitHub
#spacemacs
<
2018-10-14
>
practicalli-johnny13:10:28

@kommen I just saw an example of multi-line editing in the REPL in the #emacs channel, so considering a pull request that does the equivalent of this, but defined in the usual keybinding form in the Clojure layer. RET creates new lines and indents, C-RET evaluates the expression. This works the same way in other tools, eg. Atom, VSCode, LightTable, rebelreadline, etc

(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
  (define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)

kommen19:10:48

@jr0cket I’ll recheck the RET behaviour in my pull request. it works on my machine:tm:. but i’ll make my colleagues try it as well.

kommen19:10:43

I considered the repl behaviour like you suggest, but I think the main reason why cider by default has RET mapped to cider-repl-return is that people are way more likely type single line forms in the repl than multi line forms

kommen19:10:09

for multi line forms, having them in buffers and eval them there is a much better way anyway

kommen19:10:57

cider has cider-repl-newline-and-indent on C-j, which is shadowed by in spacemacs by cider-repl-next-input unfortunately

kommen19:10:30

I’d rather much more like to come up with an intuitive alternative for that

kommen20:10:40

@jr0cket but I think we still should discuss this with the spacemacs maintainers. care to file an issue about this? would be interesting to know if they want to be closer to cider’s default behaviour or closer to other editor implementations