Skip to content

Instantly share code, notes, and snippets.

@ubolonton
Last active October 14, 2020 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ubolonton/651788f3ae3d26cc58c2cbcd9494574d to your computer and use it in GitHub Desktop.
Save ubolonton/651788f3ae3d26cc58c2cbcd9494574d to your computer and use it in GitHub Desktop.
Minimal ~/.emacs.d/init.el with tree-sitter setup through straight.el
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;;; ^ Standard straight.el bootstrapping.
;;; --------------------------------------------------------------------------
;;; v Tree-sitter setup.
(straight-use-package 'use-package)
(require 'use-package)
;; Core APIs.
(straight-register-package
'(tsc :host github
:repo "ubolonton/emacs-tree-sitter"
:files ("core/*.el")))
;; Base framework, syntax highlighting.
(straight-use-package
'(tree-sitter :host github
:repo "ubolonton/emacs-tree-sitter"
:files ("lisp/*.el")))
;; Language bundle.
(straight-use-package
'(tree-sitter-langs :host github
:repo "ubolonton/emacs-tree-sitter"
:files ("langs/*.el" "langs/queries")))
(use-package tree-sitter
:demand t
:config (global-tree-sitter-mode)
:hook (tree-sitter-after-on . tree-sitter-hl-mode))
(use-package tree-sitter-langs
:after tree-sitter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment