Commit 11ef490807df

Vincent Demeester <vincent@sbr.pm>
2024-06-05 10:46:35
tools/emacs: trying out combobulate/dev…
… and refactor a bit treesitter modes. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 9451c28
tools/emacs/config/programming-config.el
@@ -7,10 +7,10 @@
   "Where all my sources are.")
 (set-register ?s `(file . ,src-dir))
 
-(use-package yaml-mode
+(use-package yaml-ts-mode
   :mode "\\.ya?ml\\'"
-  :hook ((yaml-mode . highlight-indentation-mode)
-         (yaml-mode . highlight-indentation-current-column-mode)))
+  :hook ((yaml-ts-mode . highlight-indentation-mode)
+         (yaml-ts-mode . highlight-indentation-current-column-mode)))
 
 (use-package conf-mode
   :mode ("\\.to?ml\\'" . conf-toml-mode))
tools/emacs/config/programming-go.el
@@ -30,9 +30,10 @@
                                                (replace-regexp-in-string " " "_" testrunname)))))
       (go-test--go-test (concat "-run " gotest "\\$ .")))))
 
-(use-package go-mode
-  :hook
-  (go-mode . go-ts-mode-hook))
+(use-package go-ts-mode
+  :mode (("\\.go$" . go-ts-mode)
+         ("\\.go" . go-ts-mode)
+         ("\\.go\\'" . go-ts-mode)))
 
 (provide 'programming-go)
 ;;; programming-go.el ends here
tools/emacs/config/programming-nix.el
@@ -4,7 +4,6 @@
 ;;; Code:
 (use-package nix-ts-mode
   :if *nix*
-  :after (lsp)
   :mode ("\\.nix\\'" "\\.nix.in\\'"))
 
 (use-package nix-drv-mode
tools/emacs/config/programming-treesitter.el
@@ -8,31 +8,31 @@
   (setq treesit-auto-install 'prompt)
   (global-treesit-auto-mode))
 
-(use-package treesit
-  :config
-  (use-package combobulate
-    :preface
-    (unless (package-installed-p 'combobulate)
-      (package-vc-install '(combobulate :url "https://github.com/mickeynp/combobulate"
-					:branch "development")))
-    ;; You can customize Combobulate's key prefix here.
-    ;; Note that you may have to restart Emacs for this to take effect!
-    (setq combobulate-key-prefix "C-c o")
+(unless (package-installed-p 'combobulate)
+  (package-vc-install '(combobulate :url "https://github.com/mickeynp/combobulate"
+				    :branch "development")))
 
-    ;; Optional, but recommended.
-    ;;
-    ;; You can manually enable Combobulate with `M-x
-    ;; combobulate-mode'.
-    :hook
-      ((python-ts-mode . combobulate-mode)
-       (js-ts-mode . combobulate-mode)
-       (html-ts-mode . combobulate-mode)
-       (css-ts-mode . combobulate-mode)
-       (yaml-ts-mode . combobulate-mode)
-       (typescript-ts-mode . combobulate-mode)
-       (json-ts-mode . combobulate-mode)
-       (tsx-ts-mode . combobulate-mode)
-       (go-ts-mode . combobulate-mode))))
+(use-package combobulate
+  :load-path "~/.config/emacs/elpa/combobulate"
+  :config
+  ;; You can customize Combobulate's key prefix here.
+  ;; Note that you may have to restart Emacs for this to take effect!
+  (setq combobulate-key-prefix "C-c o")
+
+  ;; Optional, but recommended.
+  ;;
+  ;; You can manually enable Combobulate with `M-x
+  ;; combobulate-mode'.
+  :hook
+  (python-ts-mode . combobulate-mode)
+  (js-ts-mode . combobulate-mode)
+  (html-ts-mode . combobulate-mode)
+  (css-ts-mode . combobulate-mode)
+  (yaml-ts-mode . combobulate-mode)
+  (typescript-ts-mode . combobulate-mode)
+  (json-ts-mode . combobulate-mode)
+  (tsx-ts-mode . combobulate-mode)
+  (go-ts-mode . combobulate-mode))
 
 (provide 'programming-treesitter)
 ;;; programming-treesitter.el ends here