Use the LSP server to reformat code
This commit is contained in:
parent
ca4600f0a0
commit
cb45cd7b4b
3 changed files with 9 additions and 20 deletions
|
|
@ -128,6 +128,11 @@
|
|||
(use-package wgrep)
|
||||
|
||||
(use-package lsp-mode
|
||||
:hook (before-save . (lambda ()
|
||||
(when (bound-and-true-p lsp-mode)
|
||||
(progn
|
||||
(lsp-organize-imports)
|
||||
(lsp-format-buffer)))))
|
||||
:init
|
||||
(setq lsp-keymap-prefix "C-z l")
|
||||
:custom
|
||||
|
|
@ -190,18 +195,6 @@
|
|||
("C-M-t" . recompile))
|
||||
:hook (python-mode . load-python-env))
|
||||
|
||||
; Requires the Python package "black"
|
||||
(use-package blacken
|
||||
:hook (python-mode . blacken-mode))
|
||||
|
||||
; Requires the Python package "isort"
|
||||
(use-package py-isort
|
||||
:hook (before-save . (lambda ()
|
||||
(when (bound-and-true-p blacken-mode)
|
||||
(py-isort-before-save))))
|
||||
:config
|
||||
(setq py-isort-options '("--profile" "black")))
|
||||
|
||||
;; Jupyter notebook integration
|
||||
(use-package ein
|
||||
:bind (("C-z j" . ein:run)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ postfix \
|
|||
pulseaudio \
|
||||
pulseaudio-utils \
|
||||
python3-poetry \
|
||||
python3-pylsp \
|
||||
python3-pylsp-black \
|
||||
python3-pylsp-isort \
|
||||
python3-pylsp-rope \
|
||||
python3.12-venv \
|
||||
qtwayland5 \
|
||||
slurp \
|
||||
|
|
|
|||
|
|
@ -1,9 +1,3 @@
|
|||
#! /usr/bin/sh
|
||||
|
||||
poetry add \
|
||||
--group dev \
|
||||
black \
|
||||
isort
|
||||
poetry add \
|
||||
--group test \
|
||||
coverage
|
||||
poetry add --group dev coverage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue