From bcfbc0f78652c044a450df64d38b4d74e1c15435 Mon Sep 17 00:00:00 2001 From: Nicholas Rodrigues Lordello Date: Wed, 26 Mar 2025 23:01:22 +0100 Subject: Add Support for Local Initialization We optionally load a `local-init.el` file to allow for local initialization code to run that we do not want to commit to Git. Unrelated small change: we specify a tree sitter loading directory in the `~/.cache/emacs` root, to the same tune as our other directory customizations where we move files that are not meant to be added to source control to the `~/.cache` directory. --- .gitignore | 2 +- config/emacs/init.el | 4 ++++ config/emacs/sanemacs.el | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3244f03..e9056e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -config/emacs/bookmarks +config/emacs/local-init.el config/nvim/plugin/packer_compiled.lua diff --git a/config/emacs/init.el b/config/emacs/init.el index 29f3a20..f7f5435 100644 --- a/config/emacs/init.el +++ b/config/emacs/init.el @@ -21,3 +21,7 @@ (load "~/.config/emacs/flavours/development.el" nil t)) (when (eq system-type 'darwin) (load "~/.config/emacs/flavours/macos.el" nil t)) + +(let ((local-init "~/.config/emacs/local-init.el")) + (when (file-exists-p local-init) + (load local-init nil t))) diff --git a/config/emacs/sanemacs.el b/config/emacs/sanemacs.el index 4a9529d..43c0576 100644 --- a/config/emacs/sanemacs.el +++ b/config/emacs/sanemacs.el @@ -35,6 +35,9 @@ (with-eval-after-load 'tramp-cache (setq tramp-persistency-file-name "~/.cache/emacs/tramp")) +;; Configure Tree-Sitter +(setq treesit-extra-load-path '("~/.cache/emacs/tree-sitter")) + ;; Configure package management (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) -- cgit v1.2.3