From 23be15a8ee1f2ac117e0960d4398116167c4382f Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Wed, 2 Feb 2022 08:37:12 +0100 Subject: [PATCH] Define and document eglot key bindings --- README.org | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index e26af17..9b37e0a 100644 --- a/README.org +++ b/README.org @@ -2101,7 +2101,11 @@ such a proper [[info:emacs#Directory Variables][.dir-locals.el]] file. '(;; Disable the `:pyls_flake8' plugin to fall back to pycodestyle. (:pylsp . (:plugins (:pyls_flake8 (:enabled t)))) (:pylsp . (:plugins (:jedi_completion (:cache_for ["astropy"])))) - (:pylsp . (:plugins (:jedi (:auto_import_modules ["numpy"]))))))) + (:pylsp . (:plugins (:jedi (:auto_import_modules ["numpy"])))))) + + (define-key eglot-mode-map (kbd "C-c n") #'flymake-goto-next-error) + (define-key eglot-mode-map (kbd "C-c p") #'flymake-goto-prev-error) + (define-key eglot-mode-map (kbd "C-c r") 'eglot-rename)) #+end_src #+caption[Start =eglot= in case of a proper =dir-local-variables-alist=]: @@ -2134,6 +2138,21 @@ such a proper [[info:emacs#Directory Variables][.dir-locals.el]] file. (:pylsp . (:plugins (:jedi_completion (:cache_for ["astropy"]))))))))) #+end_src +#+attr_latex: :booktabs yes :float table +#+caption[Eglot related key bindings]: +#+caption: Eglot related key-bindings. +#+name: tab:eglot-related-key-bindings +|---------------------------+------------------+------------------| +| command | keys | key map | +|---------------------------+------------------+------------------| +| =xref-find-definition= | {{{kbd(M-.)}}} | =global-map= | +| =xref-pop= | {{{kbd(M-\,)}}} | =global-map= | +| =flymake-goto-next-error= | {{{kbd(C-c n)}}} | =eglot-mode-map= | +| =flymake-goto-prev-error= | {{{kbd(C-c p)}}} | =eglot-mode-map= | +| =eglot-rename= | {{{kbd(C-c r)}}} | =eglot-mode-map= | +| =eldoc-doc-buffer= | {{{kbd(C-h .)}}} | =eglot-mode-map= | +|---------------------------+------------------+------------------| + Allthough the configuration of [[https://github.com/pythonic-emacs/blacken#readme][blacken]] is not explicit, I use it to format all new Python code with the [[https://black.readthedocs.io/en/stable/index.html][Python Black code formatter]]. Listing [[lst:pyproject-toml-kick-off]] and [[lst:setup-cfg-kick-off]] implement the rules in