Skip to content

Download binaries from vim #920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 11 additions & 1 deletion autoload/LanguageClient.vim
Original file line number Diff line number Diff line change
Expand Up @@ -794,11 +794,21 @@ function! LanguageClient#binaryPath() abort
return l:path . l:filename
endfunction

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.'
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

Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 1 addition & 0 deletions plugin/LanguageClient.vim
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ endfunction

command! -nargs=* LanguageClientStart :call LanguageClient#startServer(<f-args>)
command! LanguageClientStop call LanguageClient#shutdown()
command! LanguageClientInstallBinaries :call LanguageClient#installBinaries()

function! s:OnBufEnter()
if !LanguageClient#HasCommand(&filetype)
Expand Down