summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-05-27 15:32:06 +0100
committerMatthew Lemon <y@yulqen.org>2024-05-27 15:32:06 +0100
commitea12864b31bf8d096f5945ec6f68feb6d3a9ec62 (patch)
treebdf595733b8de0ebc55890ecec581f45f28a6fd1
parent0ec1eeddf4454019b151c464d974fa4aa1a59245 (diff)
Adds some python stuff
-rw-r--r--init.el30
1 files changed, 30 insertions, 0 deletions
diff --git a/init.el b/init.el
index 8437a24..3f2bb80 100644
--- a/init.el
+++ b/init.el
@@ -665,8 +665,38 @@ Restart works only on graphic display."
;; eglot language server protocol client
(use-package eglot
:ensure t
+ :config
+ (add-to-list 'eglot-server-programs '(python-mode . ("pyright")))
+ (setq-default eglot-workspace-configuration
+ '((:pylsp . (:configurationSources ["flake8"] :plugins (:pycodestyle (:enabled nil) :mccabe (:enabled nil) :flake8 (:enabled t))))))
:hook (python-mode . eglot-ensure))
+(use-package lsp-pyright
+ :ensure t
+ :hook (python-mode . (lambda ()
+ (require 'lsp-pyright)
+ (lsp)))) ; or lsp-deferred
+
+;; Enable LSP support by default in programming buffers
+(add-hook 'prog-mode-hook #'eglot-ensure)
+
+;; Enabled inline static analysis
+(add-hook 'prog-mode-hook #'flymake-mode)
+
+;;; Indication of local VCS changes
+(unless (package-installed-p 'diff-hl)
+ (package-install 'diff-hl))
+
+;; Enable `diff-hl' support by default in programming buffers
+(add-hook 'prog-mode-hook #'diff-hl-mode)
+
+;;; Pop-up completion
+(unless (package-installed-p 'corfu)
+ (package-install 'corfu))
+
+;; Enable autocompletion by default in programming buffers
+(add-hook 'prog-mode-hook #'corfu-mode)
+
;; emacs-async - for helm
(use-package async
:ensure t)