aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2025-03-26 23:01:22 +0100
committerNicholas Rodrigues Lordello <[email protected]>2025-03-26 23:01:22 +0100
commitbcfbc0f78652c044a450df64d38b4d74e1c15435 (patch)
tree84149871f75764d217e26c575b5573e4fddeff22
parent2a11d2649bcefe819636600e69a7e5972d48408d (diff)
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.
-rw-r--r--.gitignore2
-rw-r--r--config/emacs/init.el4
-rw-r--r--config/emacs/sanemacs.el3
3 files changed, 8 insertions, 1 deletions
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)