Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added JS repl via skewer-mode and livid-mode to javascript layer #2979

Closed
wants to merge 1 commit into from

Conversation

dcluna
Copy link
Contributor

@dcluna dcluna commented Sep 11, 2015

skewer-mode is a very good REPL for Javascript, and its setup is very easy (just install a Grease/TamperMonkey script) compared to other options (swank-js, jss). This PR adds it to the javascript layer, and includes livid-mode for hot reloading of a JS buffer.

This is the corrected version of #2975.

@dcluna dcluna changed the title Added JS repl via skewer-mode and livid-mode Added JS repl via skewer-mode and livid-mode to javascript layer Sep 11, 2015
@robbyoconnor
Copy link
Contributor

❤️ 👍 👍 👍

@CestDiego
Copy link
Contributor

I love this! :)

| ~SPC m s b~ | loads the current file in the skewer REPL |
| ~SPC m s e~ | evaluates the last expression |
| ~SPC m s p~ | prints the result of the last expression |
| ~SPC m s d~ | evaluates the current function at point |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dcluna dcluna force-pushed the js-repl branch 2 times, most recently from 4e76eb4 to 74f4ab0 Compare October 8, 2015 02:08
@dcluna
Copy link
Contributor Author

dcluna commented Oct 8, 2015

@syl20bnr Implemented your suggestions, should be good to go now.

@stormpat
Copy link
Contributor

stormpat commented Oct 8, 2015

@dcluna Good job!

@robbyoconnor
Copy link
Contributor

Nice job @dcluna ❤️

@ghost
Copy link

ghost commented Oct 9, 2015

@dcluna ❤️ and 👍. I just started looking for how to integrate skewer in Spacemacs.

@dvcrn
Copy link
Contributor

dvcrn commented Oct 14, 2015

Cool stuff! Thanks for adding this!

I noticed that when skewer throws an error, focus is shifted to the repl and I have to jump back into my code manually. Would it be possible to not do that?

Clojure is doing it pretty nice: e e evaluates without focus while e E evaluates with jumping to the repl. same for buffer: s b evaluates without focus, s B evaluates and switches. You get the idea 😀

@ghost
Copy link

ghost commented Oct 22, 2015

Any updates on this?

@dcluna
Copy link
Contributor Author

dcluna commented Oct 22, 2015

@dvcrn This is standard Skewer behavior, and while I agree that it would be a nice addition, I don't have the time to do it.

@CestDiego
Copy link
Contributor

@dcluna this has to be updated because the new way of declaring major modes keybindings is with spacemacs/set-leader-keys-for-major-mode

@dcluna
Copy link
Contributor Author

dcluna commented Dec 7, 2015

@CestDiego Done, can you review again?

@nashamri
Copy link
Contributor

👍 for this one!

@CestDiego
Copy link
Contributor

@dcluna great :D

@nashamri
Copy link
Contributor

Just tested it and it seems to be working fine.

:defer t
:init
(progn
(defalias 'js-live-eval 'livid-mode "Minor mode for automatic evaluation of a JavaScript buffer on every change")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this alias ? Is it just for which-key ?

@syl20bnr
Copy link
Owner

Thank you for the PR and your patience ! 👍
I improved it a bit in commit ba403b2 by adding more functions to fit the conventions, also livid-mode is now a toggle on SPC m s a.
Cherry-picked into develop branch, you can safely delete your branch.

@syl20bnr syl20bnr closed this Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants