summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-11-10 19:34:21 -0800
committerFranck Cuny <franck@fcuny.net>2023-11-10 19:34:21 -0800
commit147000cfa6d333d88ced6575c2a0119c0de01215 (patch)
treefb2fe3ed39924182dd8e5301653017f10c2ac660
parentsimplify a number of things in the configuration (diff)
downloademacs.d-147000cfa6d333d88ced6575c2a0119c0de01215.tar.gz
configure correctly eglot and yasnippets
I want snippets for function signatures in go to be inserted with
eglot.
-rw-r--r--init.org18
1 files changed, 10 insertions, 8 deletions
diff --git a/init.org b/init.org
index 80a717a..6b9cc3a 100644
--- a/init.org
+++ b/init.org
@@ -447,14 +447,9 @@ Corfu enhances in-buffer completion with a small completion popup.
 #+begin_src emacs-lisp
 (use-package yasnippet
   :ensure t
+  :defer t
   :diminish
-  :mode ("/emacs\\.d/snippets/" . snippet-mode)
-
-  :config
-  (yas-load-directory (emacs-path "snippets"))
-
-  :init
-  (yas-global-mode 1))
+  :hook ((prog-mode . yas-minor-mode)))
 #+end_src
 
 ** dired
@@ -855,7 +850,13 @@ For languages where I want to use LSP, I need to add ~:hook (nix-mode . englot-e
   :after yasnippet
   :bind (:map eglot-mode-map
               ("C-c l a" . eglot-code-actions)
-              ("C-c l r" . eglot-rename)))
+              ("C-c l r" . eglot-rename))
+  :config
+  (setq-default eglot-workspace-configuration
+				'((gopls
+				   (usePlaceholders . t)
+				   (staticcheck . t)
+				   (completeUnimported . t)))))
 #+end_src
 *** tree-sitter
 
@@ -929,6 +930,7 @@ For languages where I want to use LSP, I need to add ~:hook (nix-mode . englot-e
 #+begin_src emacs-lisp
 (use-package go-mode
   :ensure t
+  :defer t
   :hook ((go-mode . tree-sitter-hl-mode)
          (go-mode . eglot-ensure)
          (go-mode . (lambda () (setq tab-width 4)))