Skip to content

Instantly share code, notes, and snippets.

@ubolonton
Last active December 1, 2021 16:19
Show Gist options
  • Save ubolonton/07426a107aca7bb6e31b18d3669679bc to your computer and use it in GitHub Desktop.
Save ubolonton/07426a107aca7bb6e31b18d3669679bc to your computer and use it in GitHub Desktop.
(require 'tree-sitter)
(require 'tree-sitter-hl)
(defvar ppl--base-dir
(file-name-directory load-file-name)
"Directory containing this file.")
(define-derived-mode ppl-mode prog-mode "PPL"
"Major mode for editing PPL files."
(setq tree-sitter-language (tree-sitter-require 'ppl))
(setq tree-sitter-hl-default-patterns
(with-temp-buffer
(insert-file-contents (concat ppl--base-dir "queries/highlights.scm"))
(buffer-string))))
;;;###autoload
(progn
(add-to-list 'auto-mode-alist '("\\.ppl\\'" . ppl-mode)))
(provide 'ppl-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment