Skip to content

Instantly share code, notes, and snippets.

@gamb
Last active September 6, 2023 11:44
Show Gist options
  • Save gamb/8a28a7ace588ed1c26e3e665df71c20d to your computer and use it in GitHub Desktop.
Save gamb/8a28a7ace588ed1c26e3e665df71c20d to your computer and use it in GitHub Desktop.

Jump to the next error with C-; then if the next key press is RET open the eglot-code-actions menu at point.

(use-package eglot
  :config
  (defun eglot-code-actions-temporary-map (&rest arg)
    (set-temporary-overlay-map
     (let ((map (make-sparse-keymap)))
       (define-key map (kbd "RET") 'eglot-code-actions)
       map)
     nil)))

(use-package flymake
  :config
  (advice-add 'flymake-goto-next-error :before #'eglot-code-actions-temporary-map)
  :bind
  (:map flymake-mode-map
        ("C-;" . flymake-goto-next-error)
        ("C-M-!" . flymake-show-buffer-diagnostics)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment