Skip to content

Instantly share code, notes, and snippets.

@chunseoklee
Created June 26, 2020 07:02
Show Gist options
  • Save chunseoklee/762d8a9c03997339794b940657402066 to your computer and use it in GitHub Desktop.
Save chunseoklee/762d8a9c03997339794b940657402066 to your computer and use it in GitHub Desktop.
emacs python lsp
@chunseoklee
Copy link
Author

chunseoklee commented Jun 26, 2020

excerpt from link

I spent some time on pyls recently, so I'll summarize what I've done to make it work:
There are 2 Python language servers: palantir's and microsoft's. I preferred the former one, seems to be better documented and more feature-rich.

To get them to work:
pyls
Do a pip install 'python-language-server[all]' (or omit the all if you only want the basics), then add (python +lsp) to your init.el. This worked for me without changing anything. However, if you want to change settings, you can do it by adding something like this to your config.el:

(use-package! lsp
  :init
  (setq lsp-pyls-plugins-pylint-enabled t)
  (setq lsp-pyls-plugins-autopep8-enabled nil)
  (setq lsp-pyls-plugins-yapf-enabled t)
  (setq lsp-pyls-plugins-pyflakes-enabled nil)
)

for the full range of options you can check the emacs-lsp package's lsp-pyls.el file here.

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