Skip to content

Instantly share code, notes, and snippets.

@kashewnuts
Created October 3, 2018 00:23
Show Gist options
  • Save kashewnuts/9c9999b3d926c78859bb425256d9d389 to your computer and use it in GitHub Desktop.
Save kashewnuts/9c9999b3d926c78859bb425256d9d389 to your computer and use it in GitHub Desktop.
vim-lspを試そうとしたがomnifuncが設定されないのか動かない
let s:plug_dir = '~/.cache/plugged'
call plug#begin(s:plug_dir) " {{{
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
call plug#end() " }}}
" --- vim-lsp --- {{{
if executable('pyls')
" pip install python-language-server
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'whitelist': ['python'],
\ })
endif
" }}}
@kashewnuts
Copy link
Author

$ pip list
Package                Version
---------------------- ---------
autopep8               1.4
certifi                2018.8.24
flake8                 3.5.0
flake8-import-order    0.18
future                 0.16.0
isort                  4.3.4
jedi                   0.13.1
mccabe                 0.6.1
parso                  0.3.1
pip                    18.0
pipenv                 2018.7.1
pluggy                 0.7.1
pycodestyle            2.3.1
pyflakes               1.6.0
python-jsonrpc-server  0.0.2
python-language-server 0.21.1
setuptools             40.2.0
virtualenv             16.0.0
virtualenv-clone       0.3.0

@kashewnuts
Copy link
Author

LspDefinition は動いたのでvim-lspのインストールに失敗してるわけではない。

@kashewnuts
Copy link
Author

autocmd FileType python setlocal omnifunc=lsp#complete で解決していた。 https://github.com/prabirshrestha/vim-lsp/blob/master/doc/vim-lsp.txt#L352-L363 に書いてあった

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment