Browse Source

LSP server stuff for python

master
Taylor Bockman 4 years ago
parent
commit
7819f86a46
  1. 23
      dotfiles/emacs.d/init.el
  2. 9
      dotfiles/emacs.d/package.el

23
dotfiles/emacs.d/init.el

@ -198,6 +198,10 @@ There are two things you can do about this warning:
;; Globally enable flycheck
(add-hook 'after-init-hook #'global-flycheck-mode)
;; LSP
(require 'lsp-mode)
;;;;; PYTHON ;;;;;;;;;;;;;;;;;;
;;
;; NOTES:
@ -256,6 +260,22 @@ There are two things you can do about this warning:
(add-hook 'python-mode-hook (lambda ()
(add-to-list 'company-backends 'company-jedi)))
;; Use microsoft's python language server
(require 'lsp-python-ms)
(use-package lsp-python-ms
:ensure t
:init (setq lsp-python-ms-auto-install-server t)
:hook (python-mode . (lambda ()
(require 'lsp-python-ms)
(lsp)))) ; or lsp-deferred
;; Add LSP to python mode
(add-hook 'python-mode-hook #'lsp)
;; Python testing helpers
(use-package python-pytest)
;;--------------------------------------------------------------------------------------
;; Save hooks
;;--------------------------------------------------------------------------------------
@ -278,6 +298,9 @@ There are two things you can do about this warning:
;; Switch windows with M-o
(global-set-key (kbd "M-o") 'other-window)
;; Bind pytest in python mode to M-p
(define-key python-mode-map (kbd "M-p") 'python-pytest-file)
;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lisp Binds ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;; Note: SLIME bindings require slime to be running.

9
dotfiles/emacs.d/package.el

@ -18,6 +18,12 @@
irony
counsel
swiper
;; LSP is compatible with company and the lsp-ui gives a
;; vscode-like experience.
lsp-mode
lsp-ui
lsp-python-ms
;;;;;;;;;;;;;;;;;;;;;;;;
cmake-ide
@ -41,6 +47,9 @@
slime
;;;;;;;;;;;;;;;;;;;;
;; Test helpers
python-pytest
;; Cleanup
ws-butler
;;;;;;;;;;

Loading…
Cancel
Save