commit 5e69b2528472899e5c3da4682e345dd494bfd376 Author: Mars Date: Thu Oct 3 20:26:12 2024 -0400 emac diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ce21b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +elpaca/ +config.el diff --git a/config.org b/config.org new file mode 100644 index 0000000..c585711 --- /dev/null +++ b/config.org @@ -0,0 +1,80 @@ +#+TITLE: Emacs Configuration +#+AUTHOR: Mars (@pupbrained) +#+EMAIL: mars@pupbrained.xyz +#+STARTUP: showeverything + +* Basic Setup + +** Server + +#+begin_src emacs-lisp + (require 'bind-key) + (load "server") + (unless (server-running-p) (server-start)) +#+end_src + +** Disable Auto-Save and Backup + +*** (I don't like having ~#file#~ and ~file~~ everywhere in my directories) + +#+begin_src emacs-lisp + (setq auto-save-default nil) + (setq make-backup-files nil) +#+end_src + +** Enable Real Auto Save + +#+begin_src emacs-lisp + (use-package real-auto-save + :ensure t + :config + (setq real-auto-save-interval 1) + (add-hook 'prog-mode-hook 'real-auto-save-mode)) +#+end_src + +** No Scratch On Open + +#+begin_src emacs-lisp + (setq initial-scratch-message nil) + (setq initial-buffer-choice nil) + (add-hook 'emacs-startup-hook + (lambda () + (when (and (get-buffer "*scratch*") + (not (eq (current-buffer) (get-buffer "*scratch*")))) + (kill-buffer "*scratch*")))) +#+end_src + +** Fix Indents + Enable Autopairs + +#+begin_src emacs-lisp + (electric-indent-mode 1) + (electric-pair-mode 1) + (setq c-basic-offset 2) + (setq-default indent-tabs-mode nil) + + (use-package evil + :ensure t + :init + (setq evil-split-window-below t) + (setq evil-undo-system 'undo-tree) + (setq evil-vsplit-window-right t) + (setq evil-want-C-i-jump nil) + (setq evil-want-C-u-scroll t) + (setq evil-want-integration t) + (setq evil-want-integration t) + (setq evil-want-keybinding nil) + :config + (evil-mode 1)) + + (use-package eglot + :hook (emacs-lisp-mode . eglot-ensure)) + + (use-package catppuccin-theme + :ensure t + :demand t + :config + (load-theme 'catppuccin t)) + + (setq auto-save-default nil) + (setq make-backup-files nil) +#+end_src diff --git a/early-init.el b/early-init.el new file mode 100644 index 0000000..b7ae511 --- /dev/null +++ b/early-init.el @@ -0,0 +1,5 @@ +(setq package-enable-at-startup nil) +(setq tab-always-indent 'complete) +(setq text-mode-ispell-word-completion nil) +(setq read-extended-command-predicate #'command-completion-default-include-p) + diff --git a/init.el b/init.el new file mode 100644 index 0000000..caf3287 --- /dev/null +++ b/init.el @@ -0,0 +1,48 @@ +(defvar elpaca-installer-version 0.7) +(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) +(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) +(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) +(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" + :ref nil :depth 1 + :files (:defaults "elpaca-test.el" (:exclude "extensions")) + :build (:not elpaca--activate-package))) +(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) + (build (expand-file-name "elpaca/" elpaca-builds-directory)) + (order (cdr elpaca-order)) + (default-directory repo)) + (add-to-list 'load-path (if (file-exists-p build) build repo)) + (unless (file-exists-p repo) + (make-directory repo t) + (when (< emacs-major-version 28) (require 'subr-x)) + (condition-case-unless-debug err + (if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) + ((zerop (apply #'call-process `("git" nil ,buffer t "clone" + ,@(when-let ((depth (plist-get order :depth))) + (list (format "--depth=%d" depth) "--no-single-branch")) + ,(plist-get order :repo) ,repo)))) + ((zerop (call-process "git" nil buffer t "checkout" + (or (plist-get order :ref) "--")))) + (emacs (concat invocation-directory invocation-name)) + ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" + "--eval" "(byte-recompile-directory \".\" 0 'force)"))) + ((require 'elpaca)) + ((elpaca-generate-autoloads "elpaca" repo))) + (progn (message "%s" (buffer-string)) (kill-buffer buffer)) + (error "%s" (with-current-buffer buffer (buffer-string)))) + ((error) (warn "%s" err) (delete-directory repo 'recursive)))) + (unless (require 'elpaca-autoloads nil t) + (require 'elpaca) + (elpaca-generate-autoloads "elpaca" repo) + (load "./elpaca-autoloads"))) +(add-hook 'after-init-hook #'elpaca-process-queues) +(elpaca `(,@elpaca-order)) + +(elpaca elpaca-use-package + (elpaca-use-package-mode)) + +(use-package emacs :ensure nil :config (setq ring-bell-function #'ignore)) + +(org-babel-load-file + (expand-file-name "config.org" + user-emacs-directory)) +