#+TITLE: Emacs Configuration #+PROPERTY: header-args :tangle test.el #+auto_tangle: t #+STARTUP: show2levels * Table of contents :PROPERTIES: :TOC: :include all :END: :CONTENTS: - [[#table-of-contents][Table of contents]] - [[#setting-up-packages][Setting up Packages]] - [[#setup-for-guixsd-machines][Setup for GuixSD machines]] - [[#define-and-install-packages][Define and install packages]] - [[#ui-settings][UI Settings]] - [[#basic-ui][Basic UI]] - [[#all-the-icons-diredel][all-the-icons-dired.el]] - [[#functions][Functions]] - [[#mu4e-setup--email-configuration][mu4e setup | Email configuration]] - [[#custom-key-bindings][Custom key-bindings]] - [[#org-mode-configuration][Org-mode Configuration]] :END: * TODO Setting up Packages #+begin_src emacs-lisp (require 'package) ;; recheck | Add custon snippets to my path (add-to-list 'load-path "~/dotfiles/.emacs.d/snippets") ;; Add the entire dotfiles folder in path, ;; in case we need to load from .exwm.el (add-to-list 'load-path "~/dotfiles") ;; Set custom.el in a different file, in user-emacs-directory (setq custom-file (concat user-emacs-directory "/custom.el")) #+end_src ** Setup for GuixSD machines We check the ~$HOSTNAME~, if it's one of my devices running GuixSD. we use ~guix-emacs-autoload-packages~ to load emacs packages installed using guix if ~t~ + If you are running GuixSD, replace the following hostnames ~fsociety~ or ~heisenberg~ with your own ~$HOSTNAME~ #+begin_src emacs-lisp (when (or (string= (system-name) "fsociety") (string= (system-name) "heisenberg")) (add-to-list 'load-path "~/.guix-profile/share/emacs/site-lisp") (guix-emacs-autoload-packages)) #+end_src ** Define and install packages First, we set our ~package-archives~ #+begin_src emacs-lisp (setq package-archives '(("melpa" . "https://melpa.org/packages/") ("org" . "https://orgmode.org/elpa/") ("elpa" . "https://elpa.gnu.org/packages/"))) #+end_src Load our emacs packages and activate them #+begin_src emacs-lisp (package-initialize) (unless package-archive-contents (package-refresh-contents)) #+end_src Now we list our packages in ~my-package-list~ #+begin_src emacs-lisp (defconst my-package-list '(org-snooze all-the-icons general doom-themes doom-modeline counsel which-key ivy ivy-rich all-the-icons-ivy-rich helpful org org-modern visual-fill-column rainbow-delimiters flycheck lsp-mode lsp-ui json-mode rjsx-mode typescript-mode python-mode pyvenv company company-box magit elfeed elfeed-goodies paredit corfu monkeytype sudo-edit exwm exwm-mff exwm-firefox-core consult alsamixer simple-httpd circe eshell-syntax-highlighting pdf-tools org-superstar mastodon)) #+end_src Now we define a list to be populated at each startup. /Contains the list of packages that need to be installed/ #+begin_src emacs-lisp (defvar my-missing-packages '() #+end_src Install missing packages #+begin_src emacs-lisp (dolist (p my-package-list) (when (not (package-installed-p p)) (add-to-list 'my-missing-packages p))) (when my-missing-packages (message "Emacs is now refreshing its package database...") (package-refresh-contents) ;; Install the missing packages (dolist (p my-missing-packages) (message "Installing `%s' .." p) (package-install p)) (setq my-missing-packages '())) (unless (package-installed-p 'use-package) (package-install 'use-package)) #+end_src * TODO UI Settings ** TODO Basic UI ** TODO all-the-icons-dired.el * TODO Functions * TODO mu4e setup | Email configuration * TODO Custom key-bindings * TODO Org-mode Configuration