From 929cf4c4d8146e3bff0e2efd44df054ef0e45c1b Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Fri, 29 Nov 2019 10:27:07 +0300 Subject: [PATCH 1/3] :LanguageClientInstallBinaries to download client from `vim` --- autoload/LanguageClient.vim | 12 +++++++++++- install.sh | 2 +- plugin/LanguageClient.vim | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/autoload/LanguageClient.vim b/autoload/LanguageClient.vim index 5c279dbec..610759dc4 100644 --- a/autoload/LanguageClient.vim +++ b/autoload/LanguageClient.vim @@ -794,11 +794,21 @@ function! LanguageClient#binaryPath() abort return l:path . l:filename endfunction +function! LanguageClient#installBinaries() + let l:installsh = 'cd ' . s:root . ' && ./install.sh' + let l:output = split(system(l:installsh), '\n') + for l:line in l:output + echomsg l:line + endfor + echomsg "Success." +endfunction + function! s:Launch() abort let l:binpath = LanguageClient#binaryPath() if executable(l:binpath) != 1 - call s:Echoerr('LanguageClient: binary (' . l:binpath . ') doesn''t exists! Please check installation guide.') + call s:Echoerr('LanguageClient: binary (' . l:binpath . ') doesn''t exists!') + call s:Echoerr('Run :LanguageClientInstallBinaries or check installation guide.') return 0 endif diff --git a/install.sh b/install.sh index 97b7a6a64..a12181c0d 100755 --- a/install.sh +++ b/install.sh @@ -13,7 +13,7 @@ arch=$(uname -sm) try_curl() { command -v curl > /dev/null && \ - curl --fail --location "$1" --output bin/$name + curl --fail --silent --show-error --location "$1" --output bin/$name } try_wget() { diff --git a/plugin/LanguageClient.vim b/plugin/LanguageClient.vim index 93a667fb9..59a7239ad 100644 --- a/plugin/LanguageClient.vim +++ b/plugin/LanguageClient.vim @@ -156,6 +156,7 @@ endfunction command! -nargs=* LanguageClientStart :call LanguageClient#startServer() command! LanguageClientStop call LanguageClient#shutdown() +command! LanguageClientInstallBinaries :call LanguageClient#installBinaries() function! s:OnBufEnter() if !LanguageClient#HasCommand(&filetype) From 79b059c83be0d132af62fa1d39f10a55582e9a3f Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Fri, 29 Nov 2019 10:40:05 +0300 Subject: [PATCH 2/3] Document installation process with `:LanguageClientInstallBinaries` --- INSTALL.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 70b13d361..b30beed85 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -64,21 +64,14 @@ Restart neovim and run `:call dein#install()` to install. ## Manual -Clone this repo into some place, e.g., `~/.vim-plugins` +Clone this repo into `vim` plugin dir. ```sh -mkdir -p ~/.vim-plugins -cd ~/.vim-plugins +mkdir -p ~/.vim/pack/git-plugins/start +cd ~/.vim/pack/git-plugins/start git clone --depth 1 https://github.com/autozimu/LanguageClient-neovim.git -cd LanguageClient-neovim -bash install.sh -``` - -Add this plugin to vim/neovim `runtimepath`, - -```vim -set runtimepath+=~/.vim-plugins/LanguageClient-neovim ``` +Then use `:LanguageClientInstallBinaries` to download `languageclient`. # Install language servers From 533fe6c5d168f02503b5f62cca0325b3b02ed7c1 Mon Sep 17 00:00:00 2001 From: Anatoli Babenia Date: Mon, 2 Dec 2019 09:47:07 +0300 Subject: [PATCH 3/3] Fix `vint autoload plugin` errors autoload/LanguageClient.vim:599:1: Use the abort attribute for functions in autoload (see Google VimScript Style Guide (Functions)) autoload/LanguageClient.vim:605:13: Prefer single quoted strings (see Google VimScript Style Guide (Strings)) --- autoload/LanguageClient.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/LanguageClient.vim b/autoload/LanguageClient.vim index 610759dc4..c64389412 100644 --- a/autoload/LanguageClient.vim +++ b/autoload/LanguageClient.vim @@ -794,13 +794,13 @@ function! LanguageClient#binaryPath() abort return l:path . l:filename endfunction -function! LanguageClient#installBinaries() +function! LanguageClient#installBinaries() abort let l:installsh = 'cd ' . s:root . ' && ./install.sh' let l:output = split(system(l:installsh), '\n') for l:line in l:output echomsg l:line endfor - echomsg "Success." + echomsg 'Success.' endfunction function! s:Launch() abort