Your browser does not support JavaScript!
Upvotes Anonymous 1 User 0

How to setup JavaScript auto-complete in Spacemacs on Windows

Install NodeJS
Install NodeJS.
Install Tern
Open a command prompt and run:
npm install -g tern
Note the path where Tern is installed:
Update your .spacemacs
Add the tern-command line below to the .spacemacs file in your home directory (but modify the path to be where Tern was installed on your system):
(defun dotspacemacs/user-config ()
  "Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."

  (setq tern-command '("node" "C:/Users/Jason/AppData/Roaming/npm/node_modules/tern/bin/tern"))

Open a sample JavaScript file
Let's open a file containing the JavaScript found in this tutorial and start typing:
It's working great, but it doesn't auto-complete symbols from different files.
How can I get this to work across files?
We need to create a JSON configuration file for Tern. We can do this by creating a .tern-project file in our project's directory.
Was this helpful?



Leave a Comment

I agree to the Terms of Service
Design © 2015, Downranked, LLC.,
Original user code contributions under MIT License