Closed Gabirel closed 6 years ago
Make sure your SpaceVim is up-to-date.
npm
or cnpm
Here are the examples:
Arch:
sudo pacman -S npm nodejs
Fedora:
sudo dnf install npm nodejs
Ubuntu:
sudo apt install npm nodejs
tern
You have to install tern since tern_for_vim using tern as a server to provide auto-completion.(If I was wrong, please tell me. Because I am not a expert of nodejs)
Just Simply run:
npm install tern
Or
cnpm install tern
PS: If you want to execute, please install cnpm
.
~/.SpaceVim.d/init.vim
call SpaceVim#layers#load('lang#javascript')
And restart your vim to let SpaceVim itself to install plugins for you.
_If it takes a long time to install tern_for_vim
, please install it manually by 3 steps below:_
$ cd ~/.cache/vimfiles/repos/github.com/ternjs $ git clone https://github.com/ternjs/tern_for_vim $ cd tern_for_vim; npm install
The most important step is about how to configure your environment.
Actually, it's pretty easy.
It has two optinos for config.
.tern-project
(in the current directory or one of the directories above that for this project only).tern-config
(default in your home directory)See more details here
Here's the example config:
{
"plugins": {
"node": {},
"node_resolve": {},
"es_modules": {},
"modules": {}
},
"libs": [
"browser",
"ecma5",
"ecma6",
"react"
],
"ecmaVersion": 6
}
That's it!!!
Thanks to @RenChunhui, I can make this topic happen. I could never reach so for without his unselfish help.
Teach you how to make SpaceVim become a IDE for
JavaScript