Ⅰ. 插件描述
vim-lsp support for JavaScriptⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ryanolsonx/vim-lsp-javascript'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ryanolsonx/vim-lsp-javascript'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ryanolsonx/vim-lsp-javascript'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ryanolsonx/vim-lsp-javascript
Ⅳ. 文档说明
# vim-lsp-javascript
Sets up vim-lsp for JavaScript.
Installing
Dependencies
This vim plugin depends on the TypeScript Language Server and TypeScript. As TypeScript is a super-set of JavaScript, the TypeScript Language Server has the ability to give intelligent editor capabilities while developing JavaScript.
Install typescript language server using npm or yarn:
NPM
npm install -g typescript typescript-language-serverYarn
yarn global add typescript typescript-language-serverInstall the vim plugins:
" Dependencies
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'ryanolsonx/vim-lsp-javascript'Usage
- Open file in project that has package.json at root: you must have a package.json file at the root of your project. All JavaScript projects should have one anyway. If you have a use case where your project doesn't have a package.json at the root, please create an issue and I'll add a configuration option.
- Enjoy!
Have an Issue?
Try to reproduce with a minimal vimrc configuration. You can use the one included in this project to create a temp vim setup.
curl https://raw.githubusercontent.com/ryanolsonx/vim-lsp-javascript/master/minimal.vimrc -o /tmp/minimal.vimrc
vim -u /tmp/minimal.vimrc +PlugInstallLicense
MIT