Last active
October 14, 2020 10:38
-
-
Save ubolonton/651788f3ae3d26cc58c2cbcd9494574d to your computer and use it in GitHub Desktop.
Minimal ~/.emacs.d/init.el with tree-sitter setup through straight.el
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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