Copy over my Eglot keybindings from my el-get config
This commit is contained in:
parent
a614f70a1f
commit
c5d0ba456f
2 changed files with 65 additions and 35 deletions
|
@ -4121,15 +4121,27 @@ automatically for every newly visited file, add a hook like this:
|
||||||
(add-hook 'SOME-MAJOR-mode #'eglot-ensure)
|
(add-hook 'SOME-MAJOR-mode #'eglot-ensure)
|
||||||
#+end_quote
|
#+end_quote
|
||||||
|
|
||||||
|
I use ~eglot~ as the main LSP entry point, and as such, I have key-bindings for the common functionality implemented by ~eglot~.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el"
|
#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el"
|
||||||
;;;; Eglot (built-in client for the language server protocol)
|
;;;; Eglot (built-in client for the language server protocol)
|
||||||
(use-package eglot
|
(use-package eglot
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:functions (eglot-ensure)
|
:functions (eglot-ensure)
|
||||||
:commands (eglot)
|
:commands (eglot)
|
||||||
|
:bind
|
||||||
|
( :map eglot-mode-map
|
||||||
|
("C-c e r" . eglot-rename)
|
||||||
|
("C-c e o" . eglot-code-action-organize-imports)
|
||||||
|
("C-c e d" . eldoc)
|
||||||
|
("C-c e c" . eglot-code-actions)
|
||||||
|
("C-c e f" . eglot-format)
|
||||||
|
;; Since eglot plugs into flymake anyway
|
||||||
|
("C-c e l" . flymake-show-buffer-diagnostics))
|
||||||
:config
|
:config
|
||||||
(setq eglot-sync-connect nil)
|
(setq eglot-sync-connect nil)
|
||||||
(setq eglot-autoshutdown t))
|
(setq eglot-autoshutdown t)
|
||||||
|
(setq eglot-extend-to-xref t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** The =unravel-langs.el= settings for ~markdown-mode~
|
** The =unravel-langs.el= settings for ~markdown-mode~
|
||||||
|
@ -4226,8 +4238,8 @@ of packaging. I use it whenever I work on my numerous Emacs packages.
|
||||||
#+end_quote
|
#+end_quote
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el"
|
#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el"
|
||||||
;;; Flymake
|
;;; Flymake
|
||||||
(use-package flymake
|
(use-package flymake
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:bind
|
:bind
|
||||||
(:map flymake-mode-map
|
(:map flymake-mode-map
|
||||||
|
@ -4254,8 +4266,8 @@ of packaging. I use it whenever I work on my numerous Emacs packages.
|
||||||
flymake-mode-line-note-counter ""))
|
flymake-mode-line-note-counter ""))
|
||||||
(setq flymake-show-diagnostics-at-end-of-line nil)) ; Emacs 30
|
(setq flymake-show-diagnostics-at-end-of-line nil)) ; Emacs 30
|
||||||
|
|
||||||
;;; Elisp packaging requirements
|
;;; Elisp packaging requirements
|
||||||
(use-package package-lint-flymake
|
(use-package package-lint-flymake
|
||||||
:ensure t
|
:ensure t
|
||||||
:after flymake
|
:after flymake
|
||||||
:config
|
:config
|
||||||
|
@ -4587,6 +4599,14 @@ Prot is the developer of this package.
|
||||||
:hook ((lisp-data-mode lisp-mode clojure-mode clojure-ts-mode cider-repl-mode inferior-emacs-lisp-mode) . paredit-mode))
|
:hook ((lisp-data-mode lisp-mode clojure-mode clojure-ts-mode cider-repl-mode inferior-emacs-lisp-mode) . paredit-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** The =unravel-langs.el= section for Python
|
||||||
|
:PROPERTIES:
|
||||||
|
:CUSTOM_ID: h:EA5EA223-F97D-4EE9-8663-99822A037618
|
||||||
|
:END:
|
||||||
|
|
||||||
|
The built-in Python mode for Emacs goes a long way. We build minimal tooling around this mode, specifically to support ~eglot~ and Python's virtualenv system.
|
||||||
|
|
||||||
|
Anytime you create a virtualenv, you should run the following command: =pip3 install ruff
|
||||||
** Finally, we provide the =unravel-langs.el= module
|
** Finally, we provide the =unravel-langs.el= module
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el"
|
#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el"
|
||||||
|
|
|
@ -30,9 +30,19 @@
|
||||||
:ensure nil
|
:ensure nil
|
||||||
:functions (eglot-ensure)
|
:functions (eglot-ensure)
|
||||||
:commands (eglot)
|
:commands (eglot)
|
||||||
|
:bind
|
||||||
|
( :map eglot-mode-map
|
||||||
|
("C-c e r" . eglot-rename)
|
||||||
|
("C-c e o" . eglot-code-action-organize-imports)
|
||||||
|
("C-c e d" . eldoc)
|
||||||
|
("C-c e c" . eglot-code-actions)
|
||||||
|
("C-c e f" . eglot-format)
|
||||||
|
;; Since eglot plugs into flymake anyway
|
||||||
|
("C-c e l" . flymake-show-buffer-diagnostics))
|
||||||
:config
|
:config
|
||||||
(setq eglot-sync-connect nil)
|
(setq eglot-sync-connect nil)
|
||||||
(setq eglot-autoshutdown t))
|
(setq eglot-autoshutdown t)
|
||||||
|
(setq eglot-extend-to-xref t))
|
||||||
|
|
||||||
;;; Markdown (markdown-mode)
|
;;; Markdown (markdown-mode)
|
||||||
(use-package markdown-mode
|
(use-package markdown-mode
|
||||||
|
|
Loading…
Reference in a new issue