-
Notifications
You must be signed in to change notification settings - Fork 324
Servers Python
Chandra Sekar S edited this page Feb 6, 2026
·
9 revisions
A Python 2.7 and 3.4+ implementation of the Language Server Protocol.
pip install python-language-serverOnce the python-language-server is installed, you can register the python-language-server in your .vimrc
if executable('pyls')
au User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'whitelist': ['python'],
\ })
endifpython-language-server has several settings that can be tweaked through the workspace configuration. For example, enabling pydocstyle (which is disabled by default):
if executable('pyls')
au User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'whitelist': ['python'],
\ 'workspace_config': {'pyls': {'plugins': {'pydocstyle': {'enabled': v:true}}}}
\ })
endifThe full set of options that can be manipulated can be found in package.json.
ty is a type checker and language server for Python. ruff is a linter and code formatter for Python.
uv tool install ty
uv tool install ruffIf you do not use uv, use the tool you prefer for installing executable Python packages.
if executable('ty')
au User lsp_setup call lsp#register_server({
\ 'name': 'ty',
\ 'cmd': {server_info->['ty', 'server']},
\ 'allowlist': ['python'],
\ })
endif
if executable('ruff')
au User lsp_setup call lsp#register_server({
\ 'name': 'ruff',
\ 'cmd': {server_info->['ruff', 'server']},
\ 'allowlist': ['python'],
\ })
endif