Fork me on GitHub
#spacemacs
<
2020-01-02
>
mmeix12:01:40

Very short question: eval top level sexp and pretty-print to comment : I would like to bind this to , e ; (such how it is written in the docs), but don’t know how (being a Spacemacs newbie)

lispyclouds12:01:59

@mmeix maybe this should work by placing this in your .spacemacs file in the dotspacemacs/user-config section

(spacemacs/set-leader-keys-for-major-mode
    'clojure-mode "e;" 'cider-pprint-eval-last-sexp-to-comment)

mmeix12:01:28

trying …

mmeix13:01:22

Thanks, that worked! So all those personal settings should go into dotspacemacs/user-config - noted!

lispyclouds13:01:06

yep, thats executed at the end when spacemacs loads and can override existing settings too.

mmeix13:01:31

Great, thanks

😄 4
practicalli-john19:01:04

@mmeix I am assuming you are using the master branch of Spacemacs, as the develop branch has that keybinding in already, along with about 2 years worth of improvements for the Clojure layer and Spacemacs itself (there will be a master release some day, but for now develop is quite stable) . You might also want to look at my online guide for Clojure development with Spacemacs https://practicalli.github.io/spacemacs/

mmeix19:01:56

will install the dev build - thanks!

practicalli-john20:01:36

Feel free to ask any questions you have here, its a friendly channel and welcome to Spacemacs...

🙂 4
mmeix20:01:03

That would be this one, right?

git clone -b develop  ~/.emacs.d

practicalli-john00:01:16

I just clone

git clone  ~/.emacs.d
and then git checkout develop in the .emacs.d directory it creates

mmeix10:01:37

Ah ok (guess I have to learn git proper)

spfeiffer18:01:16

Well, @mmeix, your command does exactly the same, but in one command instead of two. So it may be more "proper" 😉

mmeix19:01:16

[learning … and not speaking English natively]

kwrooijen21:01:01

Any tools to convert javascript to cljs? I’m currently reading a book, and copy pasting javascript snippets, so I can rewrite them more easily. But having to rewrite them is a bit tedious and it would be nice if there was some sort of refactor function to (for example) convert: foo.bar.baz("abc", 123); into (.. foo -bar (baz "abc" 123))

practicalli-john20:01:04

I would imagine that given the broad syntax of JavaScript, you would only get a very narrow translation if there were such a tool. I would also be weary about direct translations. I appreciate you need to start somewhere, but the programming model between JavaScript and ClojureScript is not that close. You can always put js/ in front of many javascript function names until you discover more about ClojureScript. Sorry, I can be of more help.