Update python for emacs29.
This commit is contained in:
parent
1bed94b1b1
commit
cd02a14792
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
(require 'util-vertico)
|
(require 'util-vertico)
|
||||||
|
|
||||||
;; (require 'lang-python)
|
(require 'lang-python)
|
||||||
|
|
||||||
;; (require 'lang-javascript)
|
;; (require 'lang-javascript)
|
||||||
|
|
||||||
|
@ -52,11 +52,11 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
(use-package python
|
(use-package python
|
||||||
:mode ("\\.py\\'" . python-mode)
|
:mode ("\\.py\\'" . python-ts-mode)
|
||||||
:commands python-mode
|
:commands (python-mode python-ts-mode)
|
||||||
:pin manual
|
:pin manual
|
||||||
:hook (
|
:hook (
|
||||||
(python-mode . (lambda ()
|
(python-ts-mode . (lambda ()
|
||||||
(when (executable-find "poetry")
|
(when (executable-find "poetry")
|
||||||
(add-poetry-venv-to-path)
|
(add-poetry-venv-to-path)
|
||||||
(let ((venv (locate-venv-poetry))) (when venv
|
(let ((venv (locate-venv-poetry))) (when venv
|
||||||
@ -64,14 +64,19 @@
|
|||||||
(list (cons ':python (list ':venvPath venv ':pythonPath (concat venv "/bin/python")))))
|
(list (cons ':python (list ':venvPath venv ':pythonPath (concat venv "/bin/python")))))
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
|
(when-linux
|
||||||
(eglot-ensure)
|
(eglot-ensure)
|
||||||
|
)
|
||||||
|
|
||||||
(add-hook 'before-save-hook 'python-fmt nil 'local)
|
(add-hook 'before-save-hook 'python-fmt nil 'local)
|
||||||
(tree-sitter-hl-mode +1)
|
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
:bind ((:map python-mode-map ([backspace] . python-backspace))
|
:bind ((:map python-ts-mode-map ([backspace] . python-backspace))
|
||||||
)
|
)
|
||||||
|
:init
|
||||||
|
(add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode))
|
||||||
|
(add-to-list 'treesit-language-source-alist '(python "https://github.com/tree-sitter/tree-sitter-python"))
|
||||||
|
(unless (treesit-ready-p 'python) (treesit-install-language-grammar 'python))
|
||||||
)
|
)
|
||||||
|
|
||||||
(provide 'lang-python)
|
(provide 'lang-python)
|
||||||
|
@ -35,9 +35,6 @@
|
|||||||
(add-to-list 'eglot-server-programs (cons 'rust-ts-mode (list rust-analyzer-command)))
|
(add-to-list 'eglot-server-programs (cons 'rust-ts-mode (list rust-analyzer-command)))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
(when-linux
|
|
||||||
(tree-sitter-hl-mode +1)
|
|
||||||
)
|
|
||||||
(add-hook 'before-save-hook 'eglot-format-buffer nil 'local)
|
(add-hook 'before-save-hook 'eglot-format-buffer nil 'local)
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
|
@ -3,4 +3,5 @@
|
|||||||
name:
|
name:
|
||||||
- aspell-en
|
- aspell-en
|
||||||
- prettier # typescript+yaml formatting
|
- prettier # typescript+yaml formatting
|
||||||
|
- pyright
|
||||||
state: present
|
state: present
|
||||||
|
Loading…
Reference in New Issue
Block a user