;; -*- lexical-binding: t -*- ;; Bootstrap straight.el for package management (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) ;; Disable package.el from loading at startup (setq package-enable-at-startup nil) (ad ;; Ensure custom writes to specific file (setq custom-file (expand-file-name "custom.el" user-emacs-directory)) (load custom-file 'noerror 'nomessage) ;; Change the location of file backups/locks into the emacs.d/backups/ (setq backup-directory-alist `(("." . ,(concat user-emacs-directory "backups")))) ;;;; VISUAL ;; Disable Scroll bar, menubar (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) ;; Set location of custom theme dir (setq custom-theme-directory (concat user-emacs-directory "themes")) (load-theme 'UniverseHighContrast) ;;;; END VISUAL ;;;; PACKAGE INSTALL AND CONFIG ;; Set the packagemanager of use-package (setq straight-use-package-by-default t) ;; Default to lazy loading (setq use-package-always-defer t) ;; Ensure use-package.el is installed (straight-use-package 'use-package) ;; Ensure shell variables are loaded (use-package exec-path-from-shell :init (when (memq window-system '(mac ns x)) (exec-path-from-shell-initialize)) ) ;; Profiling (use-package esup) ;; Prevents emacs and packages from messily writing to dirs (use-package no-littering :demand t) ;;;; Science Related (use-package conda) ;;;; End Science Related ;;;; Web Related (use-package web-mode :init (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) ) (use-package php-mode) ;;;; End Web related ;;;; C Related (use-package irony :init (add-hook 'c++-mode-hook 'irony-mode) (add-hook 'c-mode-hook 'irony-mode) (add-hook 'objc-mode-hook 'irony-mode) (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) ) ;;;; End C Related ;;;; Company Related (use-package company :demand t :bind (("C-" . company-complete)) :custom-face (company-preview ((t (:background "#000000" :foreground "#ffffff")))) (company-preview-common ((t (:inherit company-preview :foreground "#ff00cf")))) (company-preview-search ((t (:inherit company-preview :background "black")))) (company-scrollbar-bg ((t (:background "grey35")))) (company-scrollbar-fg ((t (:background "#a22390")))) (company-template-field ((t (:background "grey75" :foreground "black")))) (company-tooltip ((t (:background "#353535" :foreground "white")))) (company-tooltip-common ((t (:foreground "magenta")))) (company-tooltip-mouse ((t (:inherit company-tooltip-selection)))) (company-tooltip-search ((t (:inherit company-tooltip-selection)))) (company-tooltip-search-selection ((t (:inherit company-tooltip-selection)))) (company-tooltip-selection ((t (:background "#4584a2" :foreground "white")))) ) (add-hook 'after-init-hook 'global-company-mode) ; Python (use-package company-jedi) ; C related (use-package company-ctags) (use-package company-c-headers) (use-package company-irony) ; Haskell (use-package company-ghci) ;;;; End Company Related ;;;; Haskell Related (use-package haskell-mode :config (setq haskell-mode-hook '(flyspell-prog-mode interactive-haskell-mode)) ) (use-package ghci-completion) ;;;; End Haskell Related ;;;; Org Related ;; (use-package org) (use-package org-contrib) (use-package org :config (require 'org-tempo) (tempo-define-template "Lab Template" '("#+TITLE: PHY324: LAB TITLE"n "#+AUTHOR: ***REMOVED*** | ***REMOVED***"n "#+DATE: \\today"n "#+LATEX_HEADER: \\usepackage{natbib}"n "#+LATEX_HEADER: \\usepackage{float}"n "#+LATEX_CLASS: labtemplate"n "#+OPTIONS: toc:nil"n ""n "* Abstract:"n "* Introduction:"n > p "* Methods:"n "* Results:"n "* Discussion:"n "bibliographystyle:ieeetr"n "bibliography:~/Documents/Bibliography/references.bib" >) " n > "#+NAME: fig:" (s name) > n > "#+ATTR_LaTeX: :placement [H]" > n > "[[" (s image) "]]" > n > p >) "