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 (https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md) 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. Can anyone help me? Thanks a lot!!!!
- fix the E501 error.
- know how to cconfigure lsp in .vimrc file.