Recently looked at node. js, but when writing, Vim does not have a good hint of JS. Then install the plugin to handle, ready to install vim-javascript. However, when installing the plugin above GitHub, it is recommended to use Vundle and pathogen.
Installing plugins, using Vundle management, is indeed a lot more convenient. The specific configuration is as follows (my operating system is Ubuntu 14.04 LTS):
1. Download Vundle, download from GitHub, I do not use Administrator privileges, is used by ordinary users to install.
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
Whether or not you have a. Vim folder, this will generate this folder.
2. Configure VIMRC, since it is not used by the root user, then directly in this user directory, create a new. vimrc file, with the following content:
set nocompatible "be iMproved
filetype off "required!
set rtp + = ~ / .vim / bundle / vundle /
call vundle # rc ()
"let Vundle manage Vundle
"required!
Bundle ‘gmarik / vundle’
"The source of the plugin can be specified in the following four ways
"a) Specify the plug-in in the vim-scripts repository in Github. Simply specify the plug-in name, and use"-"instead of spaces in the plug-in description.
"Bundle‘ L9 ’
"b) Specify the plug-ins of other user repositories in Github, use" user name / plug-in name "to specify
"add javascript vim
Bundle "pangloss / vim-javascript"
"c) Specify a non-Github Git repository plugin, you need to use the git address
"Bundle‘ git: //git.wincent.com/command-t.git ’
"d) Specify the plugin in the local Git repository
"Bundle‘ file: /// Users / gmarik / path / to / plugin ’
filetype plugin indent on "required!
There is a bundle "pangloss/vim-javascript" plugin, so you can install it in the next step.
When you are finished, turn on vim. If open no exception, basic is no problem. At this time, input: Bundleinstall, automatically will install the VIMRC written in the plugin. If there is an error, the problem is the bundle directory path.
In this way, you can write JS with peace of mind.
A picture of the drawings:
Vim Installation Vim-javascript plugin--vundle Management