Added YAML and Dockerfile treesitter grammar

This commit is contained in:
Fabio Scotto di Santolo
2025-12-25 09:54:19 +01:00
parent d2a3fa082e
commit f81fb6d3fe
6 changed files with 28 additions and 22 deletions

View File

@@ -43,8 +43,10 @@
;; Languages
'lang/c
'lang/docker
'lang/golang
'lang/shell
'lang/yaml
;; Misc
'misc/custom-functions

View File

@@ -3,6 +3,7 @@
;;;; Global / Core
(global-set-key (kbd "C-x C-b") #'ibuffer)
(global-set-key (kbd "C-<return>") 'company-complete)
(defvar fscotto/leader-map (make-sparse-keymap)
"Keymap per comandi sotto C-c.")

View File

@@ -0,0 +1,8 @@
;;; docker.el -*- lexical-binding: t; -*-
(use-package dockerfile-mode
:ensure t)
(provide 'docker)
;;; docker.el ends here

View File

@@ -7,24 +7,7 @@
:mode "\\.go\\'"
:hook
((go-ts-mode . lsp-deferred)
(go-ts-mode . fscotto/go-format-on-save))
:config
;; Go project commands
;; Modules
(define-key go-ts-mode-map (kbd "C-c m t") #'fscotto/go-mod-tidy)
(define-key go-ts-mode-map (kbd "C-c m d") #'fscotto/go-mod-download)
;; Test
(define-key go-ts-mode-map (kbd "C-c t p") #'fscotto/go-test-package)
(define-key go-ts-mode-map (kbd "C-c t a") #'fscotto/go-test-module)
(define-key go-ts-mode-map (kbd "C-c t t") #'fscotto/go-test-current-test)
;; Debug tests
(define-key go-ts-mode-map (kbd "C-c d t") #'dap-debug)
(define-key go-ts-mode-map (kbd "C-c d T")
(lambda ()
(interactive)
(dap-debug
(dap--debug-configuration
"Go :: Debug test at point")))))
(go-ts-mode . fscotto/go-format-on-save)))
(use-package go-mod-ts-mode
:ensure nil

View File

@@ -0,0 +1,8 @@
;;; yaml.el -*- lexical-binding: t; -*-
(use-package yaml-mode
:ensure t)
(provide 'yaml)
;;; yaml.el ends here

View File

@@ -13,12 +13,16 @@
(python-mode . python-ts-mode)
(sh-mode . bash-ts-mode)))
(setq treesit-language-source-alist
'((c "https://github.com/tree-sitter/tree-sitter-c")
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
(c "https://github.com/tree-sitter/tree-sitter-c")
(cpp "https://github.com/tree-sitter/tree-sitter-cpp")
(python "https://github.com/tree-sitter/tree-sitter-python")
(bash "https://github.com/tree-sitter/tree-sitter-bash")
(dockerfile "https://github.com/camdencheek/tree-sitter-dockerfile")
(go "https://github.com/tree-sitter/tree-sitter-go")
(gomod "https://github.com/camdencheek/tree-sitter-go-mod"))))
(gomod "https://github.com/camdencheek/tree-sitter-go-mod")
(js "https://github.com/tree-sitter/tree-sitter-javascript")
(json "https://github.com/tree-sitter/tree-sitter-json")
(node "https://github.com/tree-sitter/node-tree-sitter")
(python "https://github.com/tree-sitter/tree-sitter-python"))))
(provide 'treesitter)