eglot tweaks, add terraform-ls

This commit is contained in:
Erwin Boskma 2023-05-23 17:12:50 +02:00
parent 60b9355ada
commit 627d902ce8
Signed by: erwin
SSH key fingerprint: SHA256:3F6Cm6I3erRqlBwEghZWAQl6eS5WrGTX1Vs/Evec1lQ

View file

@ -1008,7 +1008,21 @@ Visualise git changes in the gutter, next to the line numbers
(add-to-list 'eglot-server-programs
'(conf-toml-mode . ("taplo" "lsp" "stdio"))
'(elixir-mode elixir-ts-mode heex-ts-mode . ("elixir-ls")))
(setq eglot-autoshutdown t))
(setq eglot-autoshutdown t
eldoc-echo-area-use-multiline-p 0.1)
:hook
(eglot-managed-mode . (lambda ()
(eglot-inlay-hints-mode 1)
(define-key eglot-mode-map (kbd "C-c l a") 'eglot-code-actions)
(define-key eglot-mode-map (kbd "C-c l f") 'eglot-format)
(define-key eglot-mode-map (kbd "C-c l h") 'eldoc)
(define-key eglot-mode-map (kbd "C-c l i") 'eglot-find-implementation)
(define-key eglot-mode-map (kbd "C-c l r") 'eglot-rename)
(define-key eglot-mode-map (kbd "C-c l t") 'eglot-find-typeDefinition)
(define-key eglot-mode-map (kbd "C-c l w d") 'eglot-list-connections)
(define-key eglot-mode-map (kbd "C-c l w r") 'eglot-reconnect)
(define-key eglot-mode-map (kbd "C-c l w q") 'eglot-shutdown)
(define-key eglot-mode-map (kbd "C-c l y") 'eglot-inlay-hints-mode))))
#+end_src
[[https://github.com/nemethf/eglot-x][eglot-x]] adds support for some LSP extensions to =eglot=
@ -1377,7 +1391,7 @@ Tell =nil= to use =nixpkgs-fmt= for formatting nix files.
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'(nix-mode . ("nil" :initializationOptions
`(:nil (:formatting (:command ("nixpkgs-fmt"))))))))
`(:nil (:formatting (:command ["nixpkgs-fmt"])))))))
#+end_src
*** Common Lisp
@ -1415,6 +1429,14 @@ Similar to =lisp=, there is [[https://github.com/clojure-emacs/cider][CIDER]] (C
:hook (terraform-mode . eglot-ensure))
#+end_src
Register =terraform-ls= with eglot
#+begin_src emacs-lisp
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'(terraform-mode . ("terraform-ls" "serve"))))
#+end_src
*** Fish
[[https://github.com/wwwjfy/emacs-fish][fish-mode]] provides a major mode for fish shell scripts