From 613869a4e430c73e2cc21a503e96918ca411b319 Mon Sep 17 00:00:00 2001
From: Liu Miao <liumiaogemini@mail.ustc.edu.cn>
Date: Tue, 15 Jun 2021 20:38:53 +0800
Subject: [PATCH] better python

---
 lisp/prog-common.el |  6 +-----
 lisp/prog-python.el | 10 +++++-----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/lisp/prog-common.el b/lisp/prog-common.el
index 614090e..e6ec3b9 100644
--- a/lisp/prog-common.el
+++ b/lisp/prog-common.el
@@ -32,11 +32,7 @@
                         "=r" #'lsp-format-region
                         "=o" #'lsp-organize-imports
                         ;; code
-                        "cr" #'lsp-rename
-                        ;; backends
-                        "bd" #'lsp-describe-session
-                        "br" #'lsp-workspace-restart
-                        "bx" #'lsp-workspace-shutdown)
+                        "cr" #'lsp-rename)
   :commands (lsp lsp-deferred))
 
 (use-package lsp-ui
diff --git a/lisp/prog-python.el b/lisp/prog-python.el
index 01bab5e..c269463 100644
--- a/lisp/prog-python.el
+++ b/lisp/prog-python.el
@@ -12,7 +12,7 @@
       (let ((file-path (expand-file-name ".venv" root-path)))
         (cond ((file-directory-p file-path)
                (pyvenv-activate file-path)
-               (setq pyvenv-activate file-path)
+               ;; (setq pyvenv-activate file-path)
                (message "Activated local virtualenv"))
               (t (message ".venv is not a directory")))))))
 
@@ -27,10 +27,10 @@
 
 (use-package lsp-pyright
   :ensure t
-  :hook (python-mode . (lambda () (require 'lsp-pyright)))
-;;  :init (when (executable-find "python3")
-;;          (setq lsp-pyright-python-executable-cmd "python3")))
-  )
+  :init (when (and *sys/linux* (executable-find "python3")
+                   (setq lsp-pyright-python-executable-cmd "python3")))
+  
+  :hook (python-mode . (lambda () (require 'lsp-pyright))))
 
 (use-package yapfify
   :ensure t
-- 
GitLab