Fleshed out new emacs config, added Guix.org, added Stump

This commit is contained in:
opal
2021-12-19 18:44:35 -08:00
parent bca10bd035
commit f94954578b
6 changed files with 286 additions and 138 deletions

View File

@@ -1,5 +1,5 @@
#+PROPERTY: header-args:emacs-lisp :tangle ~/Dotfiles/.config/emacs/init.el :mkdirp yes :lexical yes
#+TITLE: Emacs Configuration
#+PROPERTY: header-args:emacs-lisp :tangle ~/Dotfiles/config/emacs/init.el :mkdirp yes :lexical yes
Todo:
- Yassnippet
@@ -49,12 +49,14 @@ I use [[https://github.com/raxod502/straight.el][straight.el]] for managing pack
(set-default 'truncate-lines nil) ;; Wrap lines at end of screen
(setq visible-bell t) ;; Visible flash to represent a bell
(setq x-select-enable-clipboard t) ;; Enable clipboard
(global-tab-line-mode 1)
(setq inhibit-startup-message t)
;; Disable line mode for specific major/minor modes.
(dolist (mode '(org-mode-hook
term-mode-hook
shell-mode-hook
eshell-mode-hook))
(dolist (mode '(org-mode-hook))
'term-mode-hook
'shell-mode-hook
'eshell-mode-hook
(add-hook mode (lambda () (display-line-numbers-mode 0))))
#+end_src
@@ -116,12 +118,11 @@ Helpful.el is a package that reformats the describe-X functions to be much more
(use-package super-save
:straight t
:config
(super-save-mode +1)
(super-save-auto-save-when-idle t))
(super-save-mode +1))
;; Auto reverting Changed Files
(setq global-auto-revert-non-file-buffers t)
(global-auto-revert-mode 1)
(setq global-auto-revert-non-file-buffers nil)
(global-auto-revert-mode -1)
#+end_src
* Theme
I really enjoy [[https://protesilaos.com/emacs/modus-themes][Modus Themes]] by Protesilaos Stavrou. They are minimal, high contrast, and easy on the eyes.
@@ -131,8 +132,8 @@ I really enjoy [[https://protesilaos.com/emacs/modus-themes][Modus Themes]] by P
:straight t
:init
(setq modus-themes-italic-constructs t
modus-themes-bold-constructs nil
modus-themes-region '(accented bg-only no-extend)
modus-themes-bold-constructs nil
modus-themes-region '(accented bg-only no-extend)
modus-themes-org-blocks 'greyscale
modus-themes-paren-match 'intense
modus-themes-mixed-fonts t)
@@ -177,11 +178,41 @@ I really enjoy having a leader key and eschewing the Control and Alt keys entire
":" #'execute-extended-command ;; Eq to M-x
"u" #'universal-argument ;; Universal argument
"w" #'evil-window-map ;; Window functions
"h" #'help-map ;; Helper functions
"." #'find-file ;; Find file (opens in mini-buffer)
"," #'persp-switch-to-buffer ;; Switch to perspective.el minibuffer
"<" #'switch-to-buffer ;; Switch to non-perspective.el minibuffer
"s" #'swiper)) ;; Search in current buffer
"s" #'swiper ;; Search in current buffer
;; Magit
"gg" #'magit-status
"gi" #'magit-init
"gc" #'magit-clone
;; Buffers
"bd" #'kill-buffer
;; Org
; Babel
"obt" #'org-babel-tangle
; Gen
"ol" #'org-insert-link
"or" #'org-reload
; Agenda
"oa" #'org-agenda
;; Eval
"eb" #'eval-buffer
"er" #'eval-region
"ef" #'eval-defun
"el" #'eval-last-sexp
;; Describe
"df" #'describe-function
"dv" #'describe-variable
"ds" #'describe-symbol
"dk" #'describe-key
"dp" #'describe-package))
#+end_src
** Evil
@@ -218,26 +249,25 @@ At the moment, I'm trying out Ivy and counsel but I've used Vertico and liked it
** Ivy
#+begin_src emacs-lisp
(use-package ivy
:straight t
:diminish
:bind
(("C-s" . swiper)
:map ivy-minibuffer-map
("TAB" . ivy-alt-done)
("C-l" . ivy-alt-done)
("C-j" . ivy-next-line)
("C-k" . ivy-previous-line)
:map ivy-switch-buffer-map
("C-k" . ivy-previous-line)
("C-l" . ivy-done)
("C-d" . ivy-reverse-i-search-kill))
:config
(ivy-mode 1))
:straight t
:diminish
:bind (("C-s" . 'swiper)
:map ivy-minibuffer-map
("TAB" . ivy-alt-done)
("C-l" . ivy-alt-done)
("C-j" . ivy-next-line)
("C-k" . ivy-previous-line)
:map ivy-switch-buffer-map
("C-k" . ivy-previous-line)
("C-l" . ivy-done)
("C-d" . ivy-reverse-i-search-kill))
:config
(ivy-mode 1))
(use-package ivy-rich
:straight t
:after ivy
:init (icy-rich-mode 1)))
:init (ivy-rich-mode 1))
#+end_src
** Counsel
@@ -256,8 +286,17 @@ At the moment, I'm trying out Ivy and counsel but I've used Vertico and liked it
#+end_src
* Org
#+begin_src emacs-lisp
;; Set org agenda dir
(setq org-directory "~/Org/")
;; Tell Org to stop indenting inside of org source blocks.
(setq org-edit-src-content-indentation 0)
;; Open links in browser
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "firefox")
(defun opal/org-font-setup ()
;; Replace list hyphen with dot
(font-lock-add-keywords 'org-mode
@@ -289,11 +328,6 @@ At the moment, I'm trying out Ivy and counsel but I've used Vertico and liked it
(set-face-attribute 'line-number nil :inherit 'fixed-pitch)
(set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch))
;; Set org agenda dir
(setq org-directory "~/Org/")
;; Tell Org to stop indenting inside of org source blocks.
(setq org-edit-src-content-indentation 0)
(defun opal/org-mode-setup ()
(org-indent-mode)
@@ -313,87 +347,98 @@ At the moment, I'm trying out Ivy and counsel but I've used Vertico and liked it
(setq org-agenda-files
'("~/Org/projects/"
"~/Org/tasks/"
))
"~/Org/tasks/"))
(require 'org-habit)
(add-to-list 'org-modules 'org-habit)
(setq org-habit-graph-column 60)
(setq org-todo-keywords
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
(sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANC(k@)")))
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!)")
(sequence "BACKLOG(b)" "PLAN(p)" "READY(r)" "ACTIVE(a)" "REVIEW(v)" "WAIT(w@/!)" "HOLD(h)" "|" "COMPLETED(c)" "CANC(k@)")))
(setq org-refile-targets
'(("archive.org" :maxlevel . 1)
("planner.org" :maxlevel . 1)))
'(("archive.org" :maxlevel . 1)
("planner.org" :maxlevel . 1)))
;; Save Org buffers after refiling!
(advice-add 'org-refile :after 'org-save-all-org-buffers)
(setq org-tag-alist
'((:startgroup)
; Put mutually exclusive tags here
(:endgroup)
("@errand" . ?E)
("@home" . ?H)
("@work" . ?W)
("agenda" . ?a)
("planning" . ?p)
("publish" . ?P)
("batch" . ?b)
("note" . ?n)
("idea" . ?i)))
'((:startgroup)
; Put mutually exclusive tags here
(:endgroup)
("@errand" . ?E)
("@home" . ?H)
("@work" . ?W)
("agenda" . ?a)
("planning" . ?p)
("publish" . ?P)
("batch" . ?b)
("note" . ?n)
("idea" . ?i)))
;; Configure custom agenda views
(setq org-agenda-custom-commands
'(("d" "Dashboard"
((agenda "" ((org-deadline-warning-days 7)))
(todo "NEXT"
((org-agenda-overriding-header "Next Tasks")))
(tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects")))))
'(("d" "Dashboard"
((agenda "" ((org-deadline-warning-days 7)))
(todo "NEXT"
((org-agenda-overriding-header "Next Tasks")))
(tags-todo "agenda/ACTIVE" ((org-agenda-overriding-header "Active Projects")))))
("n" "Next Tasks"
((todo "NEXT"
((org-agenda-overriding-header "Next Tasks")))))
("n" "Next Tasks"
((todo "NEXT"
((org-agenda-overriding-header "Next Tasks")))))
;; Low-effort next actions
("e" tags-todo "+TODO=\"NEXT\"+Effort<15&+Effort>0"
((org-agenda-overriding-header "Low Effort Tasks")
(org-agenda-max-todos 20)
(org-agenda-files org-agenda-files)))))
;; Low-effort next actions
("e" tags-todo "+TODO=\"NEXT\"+Effort<15&+Effort>0"
((org-agenda-overriding-header "Low Effort Tasks")
(org-agenda-max-todos 20)
(org-agenda-files org-agenda-files)))))
;; Create capture templates
(setq org-capture-templates
`(("t" "Tasks")
("tt" "Task" entry (file+olp "~/org/planner/tasks.org" "Inbox")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)
`(("t" "Tasks")
("tt" "Task" entry (file+olp "~/org/planner/tasks.org" "Inbox")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)
("p" "Projects")
("pp" "Project File" entry (file+olp "~/org/projects/auto-infra-overview.org" "Inbox")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)))
("p" "Projects")
("pp" "Project File" entry (file+olp "~/org/projects/auto-infra-overview.org" "Inbox")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1)))
;; Init org font setup
(opal/org-font-setup))
#+end_src
;; Change default pretty bullets to circles
** Pretty Bullets
Creates nicer (-) bullets.
#+begin_src emacs-lisp
(use-package org-bullets
:straight t
:after org
:hook (org-mode . org-bullets-mode)
:custom
(org-bullets-bullet-list '("" "" "" "" "" "" "")))
#+end_src
** Visual Fill Mode
Creates margins in Org mode to make it more pleasant to look at.
#+begin_src emacs-lisp
; Creates margins, and centerrs content in org mode.
(defun opal/org-mode-visual-fill ()
(setq visual-fill-column-width 100
visual-fill-column-center-text t)
visual-fill-column-center-text t)
(visual-fill-column-mode 1))
(use-package visual-fill-column
:straight t
:hook (org-mode . opal/org-mode-visual-fill))
;; Org Babel
#+end_src
** Org Babel
#+begin_src emacs-lisp
;; Load languages for babel code blocks.
(with-eval-after-load 'org
(org-babel-do-load-languages
@@ -418,12 +463,45 @@ At the moment, I'm trying out Ivy and counsel but I've used Vertico and liked it
(add-to-list 'org-structure-template-alist '("css" . "src css"))
(add-to-list 'org-structure-template-alist '("cl" . "src lisp")))
#+end_src
* Programming/Editor
** General
*** Syntax (Flycheck)
#+begin_src emacs-lisp
(use-package flycheck :straight t)
#+end_src
*** Rainbow Delimiters
#+begin_src emacs-lisp
(use-package rainbow-delimiters
:straight t
:init
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
(add-hook 'org-mode-hook #'rainbow-delimiters-mode))
#+end_src
*** Rainbow Mode
Sets HTML strings to have the background of the color they represent.
#+begin_src emacs-lisp
(use-package rainbow-mode :straight t)
#+end_src
** Lisp
#+begin_src emacs-lisp
(use-package parinfer
:straight t
:init
(progn
(setq parinfer-extensions
'(defaults
pretty-parens
evil))
(add-hook 'prog-mode-hook #'parinfer-mode)))
#+end_src
* Magit
#+begin_src emacs-lisp
(use-package magit
:straight t)
#+end_src
* E-Mail
I've been using IceDove/Thunderbird for e-mail until I get around to making this a comparable solutions.
#+begin_src emacs-lisp
;; (use-package mu4e
;; :straight t
@@ -458,7 +536,9 @@ At the moment, I'm trying out Ivy and counsel but I've used Vertico and liked it
;; ("/opal.sh/Trash" . ?t)
;; ("/opal.sh/Drafts" . ?d))))
#+end_src
* IRC
* IRC
Right now I'm pretty happy with Matrix bridging into IRC rooms so this will stay commented out for now. I might try out the Emacs Matrix client at some point soon.
#+begin_src emacs-lisp
;; (use-package erc
;; :straight t