The following is my .vimrc
configuration:
call plug#begin()
" color scheme
Plug 'morhetz/gruvbox'
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
call plug#end()
if executable('pylsp')
" pip install python-lsp-server
au User lsp_setup call lsp#register_server({
'name': 'pylsp',
'cmd': {server_info->['pylsp']},
'allowlist': ['python'],
})
endif
When I write Python code, I encounter the E501 error because my line is too long. I found a key pylsp.plugins.pycodestyle.maxLineLength
in the python-lsp-server documentation that seems to fix the error. However, I don’t know where to configure this key. I hope the .vimrc
file can hold all the configurations to reduce the number of configuration files.
- fix the E501 error.
- know how to configure lsp in
.vimrc
file.