Cleanup setting up eglot/flymake mode configs
Remove some packages not being used anymore Switch python-flymake back-end to use flake8 instead of pyflakes
This commit is contained in:
parent
21598193e4
commit
22aa67ccfb
56
init.el
56
init.el
|
@ -911,21 +911,16 @@ Try `magit-clone-default-directory' if available, fall back to
|
|||
("C-c c e" . eglot)
|
||||
("C-c c a" . eglot-code-actions)
|
||||
("C-c c r" . eglot-rename))
|
||||
:hook (((nix-mode
|
||||
lua-mode
|
||||
python-base-mode
|
||||
rust-ts-mode
|
||||
fortran-mode
|
||||
f90-mode
|
||||
js-ts-mode)
|
||||
. eglot-ensure)
|
||||
(eglot-managed-mode . (lambda () (add-to-list 'flymake-diagnostic-functions #'eglot-flymake-backend t))))
|
||||
:hook (((nix-mode python-base-mode fortran-mode f90-mode) . eglot-ensure)
|
||||
(eglot-managed-mode . (lambda () (add-hook 'flymake-diagnostic-functions
|
||||
'eglot-flymake-backend nil t))))
|
||||
:custom
|
||||
(eglot-extend-to-xref t)
|
||||
(eglot-autoshutdown t)
|
||||
(eglot-autoreconnect nil)
|
||||
:config
|
||||
:init
|
||||
(setq eglot-stay-out-of '(flymake))
|
||||
:config
|
||||
(setq-default eglot-workspace-configuration
|
||||
'( :pylsp ( :plugins
|
||||
( :autopep8 (:enabled nil)
|
||||
|
@ -974,7 +969,7 @@ Try `magit-clone-default-directory' if available, fall back to
|
|||
(use-package flymake
|
||||
:bind (("C-c C-." . flymake-goto-next-error)
|
||||
("C-c C-," . flymake-goto-prev-error))
|
||||
:hook (prog-mode . flymake-mode)
|
||||
:hook (prog-mode . (lambda () (flymake-mode +1)))
|
||||
:config (require 'flymake-collection))
|
||||
|
||||
(use-package flymake-popon
|
||||
|
@ -983,7 +978,6 @@ Try `magit-clone-default-directory' if available, fall back to
|
|||
(global-flymake-popon-mode +1))
|
||||
|
||||
(use-package flymake-collection
|
||||
:defer
|
||||
:after flymake
|
||||
:custom
|
||||
;; Extra mypy config
|
||||
|
@ -998,18 +992,6 @@ Try `magit-clone-default-directory' if available, fall back to
|
|||
:after flymake
|
||||
:hook (sh-mode . flymake-shellcheck-load))
|
||||
|
||||
(use-package flymake-clippy
|
||||
:after flymake
|
||||
:hook ((rust-mode rust-ts-mode) . flymake-clippy-setup-backend))
|
||||
|
||||
(use-package flymake-eslint
|
||||
:after flymake
|
||||
:hook (js-ts-mode . flymake-eslint-enable))
|
||||
|
||||
(use-package flymake-ruff
|
||||
:after flymake
|
||||
:hook (python-base-mode . flymake-ruff-load))
|
||||
|
||||
(setq project-switch-use-entire-map t
|
||||
project-switch-commands '((project-find-file "Find file")
|
||||
(project-find-regexp "Find regexp")
|
||||
|
@ -1056,31 +1038,27 @@ Try `magit-clone-default-directory' if available, fall back to
|
|||
(require 'nix-store)
|
||||
(nix-prettify-global-mode +1))
|
||||
|
||||
(use-package nushell-ts-mode
|
||||
:defer t
|
||||
:mode "\\.nu\\'")
|
||||
|
||||
(use-package lua-mode
|
||||
:defer t)
|
||||
|
||||
(defun my/enable-fill-column (col)
|
||||
"Set and enable fill column to `COL'."
|
||||
(set-fill-column col)
|
||||
(display-fill-column-indicator-mode +1))
|
||||
|
||||
(use-package python
|
||||
:defer t
|
||||
:hook ((python-base-mode . (lambda () (my/enable-fill-column 88)))
|
||||
(python-base-mode . (lambda () (add-hook 'flymake-diagnostic-functions
|
||||
'flymake-collection-mypy nil t))))
|
||||
:custom
|
||||
(python-check-command (cond ((executable-find "ruff") "ruff check --output-format=pylint")
|
||||
((executable-find "pyflakes") "pyflakes")
|
||||
((executable-find "epylint") "epylint")
|
||||
(python-flymake-command
|
||||
(cond ((executable-find "flake8") '("flake8" "-"))
|
||||
(t ("pyflakes"))))
|
||||
(python-check-command
|
||||
(cond ((executable-find "flake8") "flake8")
|
||||
(t "pyflakes")))
|
||||
:config
|
||||
(setq python-ts-mode-hook python-mode-hook)
|
||||
(add-hook 'python-base-mode-hook (lambda () (my/enable-fill-column 88))))
|
||||
(setq python-ts-mode-hook python-mode-hook))
|
||||
|
||||
(use-package cargo
|
||||
:hook (rust-ts-mode . cargo-minor-mode))
|
||||
(use-package python-docstring
|
||||
:hook python-base-mode)
|
||||
|
||||
(use-package tramp
|
||||
:defer t
|
||||
|
|
Loading…
Reference in a new issue