diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 7c14b6e..76b1663 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -31,6 +31,7 @@ (require '99_yaml) (require '99_docker) (require '99_c_cpp) +(require '99_python) (setq custom-file (expand-file-name "emacs-custom.el" user-emacs-directory)) (load-file (expand-file-name "emacs-custom.el" user-emacs-directory)) diff --git a/.emacs.d/modes/99_python.el b/.emacs.d/modes/99_python.el new file mode 100644 index 0000000..125688c --- /dev/null +++ b/.emacs.d/modes/99_python.el @@ -0,0 +1,28 @@ +;;; 99_python.el --- -*- lexical-binding: t; -*- + +;;; Commentary: + +;;; Code: + +;;; Emacsをvenv内から立ち上げる方針が楽 + +;; ruff serverは微妙 +;; textDocument/definitionがサポートされておらず,ruff-lspを起動するよう上書きをしてもエラーが出た +;; (with-eval-after-load 'lsp-ruff +;; (setq lsp-ruff-server-command '("ruff-lsp"))) +;; pyrightを入れるのが楽 +(use-package lsp-mode + :hook (python-mode . lsp) + :config + ) + +(use-package lsp-pyright + :if (executable-find "pyright") + :hook (python-mode . (lambda () + (require 'lsp-pyright) + (lsp)))) + +;; docker連携はTODO + +(provide '99_python) +;;; 99_python.el ends here