-
Couldn't load subscription status.
- Fork 273
Vue Language Server (VLS)
This is guide on how to integrate vue-language-server with LanguageClient-neovim.
- nvim/vim
- Node.js and npm
- LanguageClient-neovim
Install vls via terminal (sudo might be required if permission was denied):
npm i vls -gVLS is the bare-bones version of Vetur, the VS Code extension. Vetur provides eslint, eslint-plugin-vue and eslint-prettier alongside vls. While not documented properly, vls requires eslint installed in the project root or globally to provide proper LSP functionalities. The recommended way would be to install these into your project and run the eslint init command inside your project making sure to select Vue.js as the framework.
# Install vls globally first, then follow these steps, make sure you select Vue.js as the framework
# Run this command in your project directory
npx eslint --initVue language server will provide the binary vls on your global $PATH. To get vls to run on any .vue file, add the server commands option:
" .vimrc/init.vim
let g:LanguageClient_serverCommands = {
" other server commands...
\ 'vue': ['vls'],
\ }If not installed globally, you can specify the exact path of the executable by replacing ['vls'] with ['/path/to/your/vls'].
If all goes well then vls should start working once you open a .vue file in vim. But in the case it does not, it will be required to provide vls with some default configs. Follow the steps below to setup the server configuration.
First enable loadSettings.
" .vimrc/init.vim
let g:LanguageClient_loadSettings=1
" Below is optional, if you want it available globally,
" else by default settings.json will reside in your project root directory ($PROJECT_ROOT/.vim/settings.json)
let g:LanguageClient_settingsPath='/full/path/to/settings.json'Then, add default configs to settings.json.