commit 1c0ccde0c1aab1019bbb00234c3d3751c15c4543 Author: depsterr Date: Sun Nov 20 16:56:34 2022 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a5fd10 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +.cache/ +auto-save-list/ +eln-cache/ +elpa/ +style +transient/ +url/ +zotero-storage/ +zotero-cache +recentf +network-security.data +secrets.el +*~ +\#*\# diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7548412 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "fira-code-mode"] + path = fira-code-mode + url = ./fira-code-mode/ diff --git a/behaviour.el b/behaviour.el new file mode 100644 index 0000000..197205b --- /dev/null +++ b/behaviour.el @@ -0,0 +1,8 @@ +;; Evil quit +(evil-define-command evil-quit + (&optional force) + :repeat nil + :repeat nil + (if (eq (window-main-window) (selected-window)) + (if (equal (buffer-name) "*dashboard*") nil (kill-buffer)) + (evil-window-delete))) diff --git a/binds.el b/binds.el new file mode 100644 index 0000000..f62fb29 --- /dev/null +++ b/binds.el @@ -0,0 +1,114 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; binds.el ;;;; +;;;; Defines keybinds ;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;; +;;;; Global ;;;; +;;;;;;;;;;;;;;;; + +;; Evil +(require 'evil) +(require 'evil-surround) +(require 'evil-commentary) +(require 'evil-leader) +(global-evil-leader-mode 1) +(evil-mode 1) +(evil-commentary-mode 1) +(global-undo-tree-mode 1) + +;; Agda input mode ∀ buffers +(load-file (let ((coding-system-for-read 'utf-8)) + (shell-command-to-string "agda-mode locate"))) +(require 'agda-input) +(add-hook 'evil-insert-state-entry-hook (lambda () + (if (not (eq major-mode 'latex-mode)) + (set-input-method "Agda")))) +(add-hook 'evil-insert-state-exit-hook (lambda () (set-input-method nil))) + +;; No evil in certain modes +(add-hook 'vterm-mode-hook 'turn-off-evil-mode) +(add-hook 'zotero-browser-mode-hook 'turn-off-evil-mode) + +;; Windowing +(define-prefix-command 'create-windows) +(global-set-key (kbd "C-a") 'create-windows) +(define-key create-windows (kbd "h") '(lambda () (interactive) + (split-window-right) + (evil-window-left 1))) +(define-key create-windows (kbd "j") '(lambda () (interactive) + (split-window-below) + (evil-window-down 1))) +(define-key create-windows (kbd "k") '(lambda () (interactive) + (split-window-below) + (evil-window-up 1))) +(define-key create-windows (kbd "l") '(lambda () (interactive) + (split-window-right) + (evil-window-right 1))) + +(global-set-key (kbd "C-h") '(lambda () (interactive) (evil-window-left 1))) +(global-set-key (kbd "C-j") '(lambda () (interactive) (evil-window-down 1))) +(global-set-key (kbd "C-k") '(lambda () (interactive) (evil-window-up 1))) +(global-set-key (kbd "C-l") '(lambda () (interactive) (evil-window-right 1))) + +(global-set-key (kbd "M-h") '(lambda () (interactive) (evil-window-decrease-width 1))) +(global-set-key (kbd "M-j") '(lambda () (interactive) (evil-window-decrease-height 1))) +(global-set-key (kbd "M-k") '(lambda () (interactive) (evil-window-increase-height 1))) +(global-set-key (kbd "M-l") '(lambda () (interactive) (evil-window-increase-width 1))) + +(global-set-key (kbd "C-") 'vterm) +(evil-global-set-key 'normal (kbd "C-t") 'treemacs) +(evil-global-set-key 'normal (kbd "C-d") 'evil-quit) +(evil-global-set-key 'emacs (kbd "C-t") 'treemacs) +(evil-global-set-key 'emacs (kbd "C-d") 'evil-quit) + +;;;;;;;;;;;;;;;;;;;;;;; +;;;; Mode specific ;;;; +;;;;;;;;;;;;;;;;;;;;;;; + +;; Elisp mode +(add-hook 'emacs-lisp-mode-hook + (lambda () (local-set-key (kbd "C-c C-l") 'eval-buffer))) + +;; Agda mode +(evil-leader/set-leader "\\") +(add-hook + 'agda2-mode-hook + (lambda () + (eval-after-load 'evil-maps + '(evil-leader/set-key + "a" 'agda2-auto-maybe-all + "b" 'agda2-previous-goal + "c" 'agda2-make-case + "d" 'agda2-infer-type-maybe-toplevel + "e" 'agda2-show-context + "f" 'agda2-next-goal + "h" 'agda2-helper-function-type + "l" 'agda2-load + "h" 'agda2-helper-function-type + "n" 'agda2-compute-normalised-maybe-toplevel + "o" 'agda2-module-contents-maybe-toplevel + "r" 'agda2-refine + "s" 'agda2-solve-maybe-all + "t" 'agda2-goal-type + "t" 'agda2-goal-type + "w" 'agda2-why-in-scope-maybe-toplevel + "z" 'agda2-search-about-toplevel + "" 'agda2-give + "g" 'agda2-show-goals + "," 'agda2-goal-and-context + "." 'agda2-goal-and-context-and-inferred + ";" 'agda2-goal-and-context-and-checked + "=" 'agda2-show-constraints + "Gb" 'agda2-go-back + "Gd" 'agda2-goto-definition-keyboard + "xa" 'agda2-abort + "xc" 'agda2-compile + "xd" 'agda2-remove-annotations + "xh" 'agda2-display-implicit-arguments + "xt" 'agda2-display-irrelevant-arguments + "xl" 'agda2-load + "xq" 'agda2-quit + "xr" 'agda2-restart + "xs" 'agda2-set-program-version + "x-" 'agda2-comment-dwim-rest-of-buffer)))) diff --git a/fira-code-mode b/fira-code-mode new file mode 160000 index 0000000..eaff81f --- /dev/null +++ b/fira-code-mode @@ -0,0 +1 @@ +Subproject commit eaff81f867d9c84e25891368f3d0cac7513984e8 diff --git a/init.el b/init.el new file mode 100644 index 0000000..b57859b --- /dev/null +++ b/init.el @@ -0,0 +1,50 @@ +;; Packages +(require 'package) +(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") + ("melpa" . "https://melpa.org/packages/"))) +(package-initialize) + +;; File inclusion +(defun path (f) (concat "/home/deppy/.emacs.d/" f)) +(defmacro include (f) (load (path f))) + +;; Keybinds +(include "binds.el") + +;; Style (theme, etc) +(include "style.el") + +;; Zotero +(require 'zotero) +(require 'zotero-browser) + +;; Secrets +(include "secrets.el") + +;; Behaviour +(include "behaviour.el") + +;; Don't touch +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(evil-undo-system 'undo-tree) + '(package-selected-packages + '(treemacs-evil treemacs solarized-theme doom-modeline all-the-icons-dired page-break-lines all-the-icons dashboard org-evil zotero vterm magit undo-fu latex-math-preview multi-term evil-terminal-cursor-changer fira-code-mode use-package haskell-mode evil-surround undo-tree evil-org evil)) + '(warning-suppress-log-types '((comp))) + '(warning-suppress-types '((comp))) + '(zotero-recognize-pdfdata + "/home/deppy/.emacs.d/elpa/zotero-20211008.2207/pdftools/poppler-data/") + '(zotero-recognize-pdfinfo + "/home/deppy/.emacs.d/elpa/zotero-20211008.2207/pdftools/pdfinfo-linux-x86_64" t) + '(zotero-recognize-pdftotext + "/home/deppy/.emacs.d/elpa/zotero-20211008.2207/pdftools/pdftotext-linux-x86_64")) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(mode-line ((t (:underline nil :overline nil)))) + '(mode-line-inactive ((t (:underline nil :overline nil))))) diff --git a/style.el b/style.el new file mode 100644 index 0000000..b401bc4 --- /dev/null +++ b/style.el @@ -0,0 +1,67 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; style.el ;;;; +;;;; purely aesthetic changes ;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Prettify +(global-prettify-symbols-mode 1) + +;; Font +(let ((fontName "Fira Code Retina-10")) + (set-face-attribute 'default t :font fontName) + (set-face-attribute 'default nil :font fontName)) + +;; Highlight long lines +(setq whitespace-line-column 100) +(setq whitespace-style '(face lines-tail)) +(add-hook 'prog-mode-hook 'whitespace-mode) + +;; Line numbers +(setq display-line-numbers-type 'relative) +(add-hook 'prog-mode-hook 'display-line-numbers-mode) + +;; Tool bar mode +(menu-bar-mode -1) +(tool-bar-mode -1) +(toggle-scroll-bar -1) + +;; Images +(setq image-use-external-converter t) + +;; Theme +(load-theme 'solarized-light t) + +;; Dashboard +(setq inhibit-splash-screen t) +(setq inhibit-startup-message t) + +(require 'dashboard) +(dashboard-setup-startup-hook) + +(setq dashboard-center-content t) + +(setq dashboard-startup-banner (path "style/evil_logo.png")) +(setq dashboard-banner-logo-title "Welcome to EVIL") +(setq dashboard-show-shortcuts nil) +(setq dashboard-footer-messages + '("The one true editor!" + "Who the hell uses VIM anyway? Go EVIL!" + "Happy coding!" + "VI VI VI, the editor of the beast" + "While any text editor can save your files, only EVIL can save your soul" + "λf. (λx. f (x x)) (λx. f (x x))")) + +(when (display-graphic-p) + (require 'all-the-icons)) + +;; Modeline +(require 'doom-modeline) +(doom-modeline-mode 1) +(setq doom-modeline-hud 1) + +(custom-set-faces + '(mode-line ((t (:underline nil :overline nil)))) + '(mode-line-inactive ((t (:underline nil :overline nil))))) + +;; Dired +(add-hook 'dired-mode-hook 'all-the-icons-dired-mode)