configs/emacs: fix eglot format-buffer stuff, add clang/rust server
This commit is contained in:
parent
5d65210ca4
commit
baa7ee6576
@ -216,9 +216,17 @@ auto-completion stuff.
|
||||
(add-hook 'typescript-mode-hook 'eglot-ensure)
|
||||
(add-hook 'ruby-mode-hook 'eglot-ensure)
|
||||
(add-hook 'perl-mode-hook 'eglot-ensure)
|
||||
|
||||
(add-to-list 'eglot-server-programs '(c-mode . ("clangd")))
|
||||
(add-to-list 'eglot-server-programs '(c++-mode . ("clangd")))
|
||||
(add-to-list 'eglot-server-programs '(rust-mode . ("rust-analyzer")))
|
||||
|
||||
(define-key eglot-mode-map (kbd "C-c r") 'eglot-rename)
|
||||
(define-key eglot-mode-map (kbd "C-c f") 'eglot-format)
|
||||
(add-hook 'before-save-hook 'eglot-format-buffer))
|
||||
|
||||
:hook
|
||||
(eglot-managed-mode . (lambda() (add-hook 'before-save-hook 'eglot-format-buffer nil 'local))))
|
||||
|
||||
|
||||
#+end_src
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user