Skip to content

Spacemacs Configuration

John Beppu edited this page Jan 16, 2018 · 5 revisions

This is for Spacemacs users who would like to setup nodejs-repl to fit smoothly into Spacemacs' javascript layer.

Installation

Add to dotspacemacs-additional-packages list inside the dotspacemacs/layers function

  dotspacemacs-additional-packages
  '(
    nodejs-repl
    )

Add this to the dotspacemacs/user-config function

  ;; nodejs-repl
  (with-eval-after-load "nodejs-repl"
    (spacemacs/set-leader-keys-for-major-mode 'js2-mode "ne" 'nodejs-repl-send-last-expression)
    (spacemacs/set-leader-keys-for-major-mode 'js2-mode "nj" 'nodejs-repl-send-line)
    (spacemacs/set-leader-keys-for-major-mode 'js2-mode "nr" 'nodejs-repl-send-region)
    (spacemacs/set-leader-keys-for-major-mode 'js2-mode "nl" 'nodejs-repl-load-file)
    (spacemacs/set-leader-keys-for-major-mode 'js2-mode "n'" 'nodejs-repl-switch-to-repl))

Usage

  • , n ' Switch to repl
  • , n e Send last expression to repl
  • , n j Send current line to repl
  • , n r Send region to repl
  • , n l Load file into repl

Clone this wiki locally