This commit is contained in:
Mars 2024-10-03 20:26:12 -04:00
commit 5e69b25284
Signed by: pupbrained
GPG key ID: 874E22DF2F9DFCB5
4 changed files with 135 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
elpaca/
config.el

80
config.org Normal file
View file

@ -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

5
early-init.el Normal file
View file

@ -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)

48
init.el Normal file
View file

@ -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))