Vim: Difference between revisions
imported>Mic92 |
imported>Mic92 add black language server + better language client short keys |
||
| Line 153: | Line 153: | ||
\ 'python': ['pyls'] | \ 'python': ['pyls'] | ||
\ } | \ } | ||
nnoremap <F5> :call LanguageClient_contextMenu()<CR> | |||
nnoremap <silent> gh :call LanguageClient_textDocument_hover()<CR> | |||
nnoremap <silent> gd :call LanguageClient_textDocument_definition()<CR> | |||
nnoremap <silent> gr :call LanguageClient_textDocument_references()<CR> | |||
nnoremap <silent> gs :call LanguageClient_textDocument_documentSymbol()<CR> | |||
nnoremap <silent> <F2> :call LanguageClient_textDocument_rename()<CR> | |||
nnoremap <silent> gf :call LanguageClient_textDocument_formatting()<CR> | |||
''; | ''; | ||
packages.myVimPackage = with pkgs.vimPlugins; { | packages.myVimPackage = with pkgs.vimPlugins; { | ||
| Line 166: | Line 173: | ||
(python3.withPackages(ps: [ | (python3.withPackages(ps: [ | ||
ps.python-language-server | ps.python-language-server | ||
# the following plugins are optional, they provide type checking | # the following plugins are optional, they provide type checking, import sorting and code formatting | ||
ps.pyls-mypy ps.pyls-isort | ps.pyls-mypy ps.pyls-isort ps.pyls-black | ||
])) | ])) | ||
</syntaxHighlight> | </syntaxHighlight> | ||