One Dotfile to rule them all!

I use org-mode’s support for Literate Programming to have all my dotfiles contained in a single file which tangles the code blocks into the correct destinations. Theoretically this should make it easier to get setup on new systems, but more importantly, it makes documenting my config easier.

Adding the following to the top of the file will tangle on save:

org code
# -*- eval: (add-hook 'after-save-hook (lambda nil (org-babel-tangle)) nil t); -*-

.emacs

header

emacs-lisp code
;; -*- mode: emacs-lisp; lexical-binding: t; -*-
; Do not edit this file directly!
; This file was generated by running ~org-babel-tangle~ on dotfiles.org

native-comp

(native-compile-async “~/.emacs.d/straight/build/magit/”)

emacs-lisp code
(setenv "LIBRARY_PATH" "/nix/store/qx9kbwz4xk7cdpv1cq42ma5865h8glfn-gcc-9.3.0-lib/lib:/nix/store/02r8mvpnbyp6286hls4zzixc6kv7w3xk-glibc-2.30/lib:/nix/store/kq3hwnp0bdia9ld9445fy829laf46vaf-libgccjit-9.3.0/lib/gcc/aarch64-unknown-linux-gnu/9.3.0/")
(setq comp-deferred-compilation-black-list '("jupyter/.*.el"))
(setq comp-deferred-compilation t)

straight.el

bootstrap

emacs-lisp code
(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))

setup use-package

emacs-lisp code
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)

better-defaults

emacs-lisp code
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)

(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)

(require 'saveplace)
(setq-default save-place t)

(show-paren-mode 1)
(setq-default indent-tabs-mode nil)
(setq save-interprogram-paste-before-kill t
      apropos-do-all t
      require-final-newline t
      load-prefer-newer t
      ediff-window-setup-function 'ediff-setup-windows-plain
      save-place-file (concat user-emacs-directory "places")
      backup-directory-alist `(("." . ,(concat user-emacs-directory
                                               "backups"))))

(blink-cursor-mode 0)
;; When emacs asks for "yes" or "no", let "y" or "n" suffice
(fset 'yes-or-no-p 'y-or-n-p)
(setq inhibit-startup-message t)
(setq ring-bell-function 'ignore)
(setq confirm-kill-emacs 'yes-or-no-p)
(setq-default fill-column 80)
(setq c-basic-offset 4)

(setq auth-source-save-behavior nil)

theme

emacs-lisp code
(add-to-list 'default-frame-alist
             '(font . "DejaVu Sans Mono 11"))
             ;;'(font . "Menlo-12"))

(use-package spacemacs-common
  :config
  (load-theme 'spacemacs-dark t)
  :straight spacemacs-theme)

(use-package all-the-icons)

spaceline

emacs-lisp code
(use-package spaceline
  :config
  (spaceline-spacemacs-theme)
  )

hl-line-mode

emacs-lisp code
(global-hl-line-mode t)
(make-variable-buffer-local 'global-hl-line-mode)
(add-hook 'vterm-mode-hook (lambda () (setq global-hl-line-mode nil)))

smooth-scrolling

emacs-lisp code
;;(use-package smooth-scrolling
;;  :config
;;  (smooth-scrolling-mode 1)
;;  (setq smooth-scroll-margin 5)
;;  )

general

emacs-lisp code
(use-package general
  :config
  ;;(general-evil-setup t)
  ;;(general-define-key
  ;; :keymaps 'normal
  ;; :prefix "SPC"
  ;; "SPC" 'helm-M-x
  ;; "f"  '(:ignore t :which-key "files")
  ;; "ff" 'helm-find-files
  ;; )
  ;;(define-key key-translation-map (kbd "C-h") (kbd "<DEL>"))
  ;;(general-define-key
  ;; "C-h" 'evil-delete-backward-char-and-join)
  (general-define-key
    ;;:keymaps 'override
   "C-h" (general-simulate-key "<backspace>"))

  (general-define-key
   :keymaps 'exwm-mode-map
   "C-h" nil)
  ;;  :states '(normal insert visual motion)
  ;;(global-set-key (kbd "s-<tab>") '(lambda () 
  ;;                                   (interactive) (switch-to-buffer nil)))
  (general-define-key 
    ;;:keymaps 'override
    :keymaps '(override exwm-mode-map)
    "C-<tab>" '(lambda () (interactive)
                 (switch-to-buffer nil)))
                 ;;(switch-to-buffer (other-buffer (current-buffer) t))))

  (general-define-key :keymaps '(override exwm-mode-map) "M-<tab>" 'ace-window)

  ;;(add-hook 'org-mode-hook
  ;;          '(lambda ()
  ;;             (define-key org-mode-map (kbd "M-<tab>") nil)))
  ;;(add-hook 'org-mode-hook
  ;;          '(lambda ()
  ;;             (define-key org-mode-map (kbd "C-<tab>") nil)))
  ;; https://stackoverflow.com/questions/4333467/override-ctrl-tab-in-emacs-org-mode
  ;;(add-hook 'eshell-mode-hook
  ;;          '(lambda ()
  ;;             (define-key eshell-mode-map (kbd "M-<tab>") nil)))
  ;;(add-hook 'magit-mode-hook
  ;;          '(lambda ()
  ;;             (define-key magit-mode-map (kbd "M-<tab>") nil)))

  (defun my-start-app (command) 
    (interactive (list (read-shell-command "$ ")))
    (start-process-shell-command command nil command))

  (defun my-toggle-window-split ()
    (interactive)
    (if (eq (count-windows) 1)
        (progn
          (split-window-right)
          (other-window 1)
          (switch-to-buffer nil)
          (other-window 1))
      (delete-other-windows)))

  (general-create-definer my-leader-def
    :prefix "SPC"
    ;;:global-prefix "C-SPC"
    :prefix-command 'my-leader-prefix-cmd
    :states '(normal visual motion)
    :keymaps 'override)

  (general-define-key 
    :keymaps '(override exwm-mode-map)
    "C-SPC" 'my-leader-prefix-cmd)

  (general-create-definer my-local-leader-def
    :prefix ","
    :states '(normal visual motion)
    :keymaps 'override)
  (my-leader-def
    "SPC" 'execute-extended-command
    "u" 'universal-argument
    "'" 'vterm
    "a"  '(:ignore t :which-key "apps")
    "as"  '(:ignore t :which-key "shell")
    "ase" 'eshell
    "ass" 'shell
    "ast" 'ansi-term
    "asv" 'vterm
    "w"  '(:ignore t :which-key "windows")
    "ww" 'my-toggle-window-split
    "w/" 'split-window-right
    "w-" 'split-window-below
    "w=" 'balance-windows
    "wd" 'delete-window
    "b"  'switch-to-buffer
    "C-b"  'switch-to-buffer
    ;;"c"  '(:ignore t :which-key "cd")
    "c"  '(:ignore t :which-key "buffers")
    "cc" 'ibuffer
    "ck" 'kill-current-buffer
    "cu" 'revert-buffer
    "cd" 'cd
    "q"  '(:ignore t :which-key "quit")
    "qq" 'save-buffers-kill-emacs
    "f"  '(:ignore t :which-key "files")
    "ff" 'find-file
    "fs" 'save-buffer
    "fa" 'save-some-buffers
    ;;"h"  'help
    "h"  '(:ignore t :which-key "help")
    "hh" 'describe-symbol
    "hm" 'describe-mode
    "hk" 'describe-key
    "hf" 'describe-function
    "hv" 'describe-variable
    "hb" 'describe-bindings
    "j"  '(:ignore t :which-key "jump")
    "ji" 'imenu
    "s"  '(:ignore t :which-key "search")
    "e" 'my-start-app
    "z" 'describe-bindings
    )
  ;;(general-define-key "s-b" 'switch-to-buffer)
  ;;(general-define-key "s-u" 'revert-buffer)
  )

evil

emacs-lisp code
(use-package evil
  :init
  (setq evil-want-integration t) ;; This is optional since it's already set to t by default.
  (setq evil-want-keybinding nil)
  (setq-default evil-move-cursor-back nil
                evil-want-C-u-scroll t
;;                evil-want-minibuffer t
                evil-want-C-i-jump nil)
  (setq evil-normal-state-cursor '(box "DarkGoldenrod2")
        evil-insert-state-cursor '((bar . 2) "chartreuse3")
        evil-emacs-state-cursor '(box "SkyBlue2")
        evil-hybrid-state-cursor '((bar . 2) "SkyBlue2")
        evil-replace-state-cursor '((hbar . 2) "chocolate")
        evil-evilified-state-cursor '(box "LightGoldenrod3")
        evil-visual-state-cursor '((hbar . 2) "gray")
        evil-motion-state-cursor '(box "plum3")
        evil-lisp-state-cursor '(box "HotPink1")
        evil-iedit-state-cursor '(box "firebrick1")
        evil-iedit-insert-state-cursor '((bar . 2) "firebrick1")
        )
  :config
  (evil-mode 1)
  (evil-set-initial-state 'term-mode 'emacs)
  (define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
  (define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
  )
(use-package evil-collection
  :after evil
  :config
  (evil-collection-init))
(use-package evil-matchit
  :after evil
  :config
  (global-evil-matchit-mode 1))
(use-package evil-surround
  :after evil
  :config
  (global-evil-surround-mode 1))

ivy

https://oremacs.com/swiper/#key-bindings

emacs-lisp code
(use-package ivy
  :init
  (setq ivy-use-virtual-buffers t)
  (setq enable-recursive-minibuffers t)
  (setq ivy-count-format "(%d/%d) ")
  (setq ivy-height 20)
  :config
  (ivy-mode 1)
  (general-def
    :keymaps 'ivy-minibuffer-map
    "C-<return>" 'ivy-immediate-done
    )

  ;(defun ivy-switch-to-exwm-action (x)
  ;  (with-ivy-window
  ;    (exwm-workspace-switch-to-buffer x)))

  ;(ivy-set-actions
  ; 'ivy-switch-buffer
  ; '(("e" ivy-switch-to-exwm-action "exwm"))
  ; )

  ;(defun ivy-call-action-key (key)
  ;  (lambda ()
  ;    (interactive)
  ;    (ivy-exit-with-action
  ;     (cadr
  ;      (assoc key
  ;             (cdr (ivy-state-action ivy-last)))))))

  ;(defun my-ivy-call-exwm ()
  ;    (interactive)
  ;    (ivy-exit-with-action
  ;     (cadr
  ;      (assoc "e"
  ;             (cdr (ivy-state-action ivy-last))))))

  ;(defun my-ivy-exwm-switch-buffer ()
  ;  (interactive)
  ;  (let ((ivy-inhibit-action t))
  ;    (exwm-workspace-switch-to-buffer (ivy-switch-buffer))))
  )

(use-package ivy-hydra
  :init
)

(use-package counsel
  :config
  (counsel-mode 1)
  (my-leader-def "sa" 'counsel-ag)
  (my-leader-def "fg" 'counsel-git)
  )

(use-package swiper
  :config
  (general-define-key "C-s" 'swiper)
  (my-leader-def "ss" 'swiper)
  )

(use-package amx
  )

;; inspired by https://github.com/pjones/ivy-exwm
(use-package ivy-rich
  :init
  (setq ivy-rich-parse-remote-buffer nil)
  ;;(setq ivy-format-function #'ivy-format-function-line)
  :config
  (defun ivy-rich-switch-buffer-exwm-or-project (candidate)
    (with-current-buffer
        (get-buffer candidate)
      (if (derived-mode-p 'exwm-mode)
          exwm-class-name
        (ivy-rich-switch-buffer-project candidate))))

  (setq ivy-rich-display-transformers-list
        '(ivy-switch-buffer
          (:columns
           ((ivy-rich-candidate (:width 60))
            (ivy-rich-switch-buffer-size (:width 7))
            (ivy-rich-switch-buffer-indicators (:width 4 :face error :align right))
            (ivy-rich-switch-buffer-major-mode (:width 18 :face warning))
            (ivy-rich-switch-buffer-exwm-or-project (:width 15 :face success))
            (ivy-rich-switch-buffer-path (:width (lambda (x) (ivy-rich-switch-buffer-shorten-path x (ivy-rich-minibuffer-width 0.3))))))
           :predicate
           (lambda (cand) (get-buffer cand)))
          counsel-M-x
          (:columns
           ((counsel-M-x-transformer (:width 40))
            (ivy-rich-counsel-function-docstring (:face font-lock-doc-face))))
          counsel-describe-function
          (:columns
           ((counsel-describe-function-transformer (:width 40))
            (ivy-rich-counsel-function-docstring (:face font-lock-doc-face))))
          counsel-describe-variable
          (:columns
           ((counsel-describe-variable-transformer (:width 40))
            (ivy-rich-counsel-variable-docstring (:face font-lock-doc-face))))
          counsel-recentf
          (:columns
           ((ivy-rich-candidate (:width 0.8))
            (ivy-rich-file-last-modified-time (:face font-lock-comment-face))))))
  (ivy-rich-mode 1)
  )

avy

emacs-lisp code
(use-package avy
  :config
  (avy-setup-default)
  ;;(my-leader-def
  ;; "jj" 'evil-avy-goto-char-timer
  ;; )
  (setq avy-all-windows nil)
  (setq avy-keys '(?a ?o ?e ?u ?h ?t ?n ?s))
  (general-define-key :states 'normal "gc" 'evil-avy-goto-char-timer);;evil-avy-goto-char-2)
  )
(use-package ace-link
  :config
  (ace-link-setup-default)
  (general-define-key :states 'normal :keymaps 'Info-mode-map "o" 'ace-link-info)
  (general-define-key :states 'normal :keymaps 'help-mode-map "o" 'ace-link-help)
  (general-define-key :states 'normal :keymaps 'help-mode-map "o" 'ace-link-help)
  (my-local-leader-def :keymaps 'org-mode-map "o" 'ace-link-org)
  )
(use-package ace-window
  :config
  ;;(general-define-key "C-o" 'ace-buffer)
  (setq aw-keys '(?h ?t ?n ?s))
  ;;(general-define-key :keymaps 'override "M-<tab>" 'ace-window)
  ;;(my-leader-def
  ;; "o" 'ace-window
  ;; )
  )

ibuffer

emacs-lisp code
(use-package ibuffer
  :straight nil
  :config
  (general-def
    :states 'normal
    :keymaps 'ibuffer-mode-map
    "<tab>" 'ibuffer-visit-buffer-other-window-noselect)
  )

dired

emacs-lisp code
(setq delete-by-moving-to-trash t)
(setq trash-directory "~/.Trash")

(setq dired-listing-switches "-alhv")
(setq dired-guess-shell-alist-user
      (list (list "\\.pdf" "open")))
(put 'dired-find-alternate-file 'disabled nil)

(general-def
  :keymaps 'dired-mode-map
  :states 'normal
  "gj" 'dired-next-subdir
  "gk" 'dired-prev-subdir
  )

yasnippet

emacs-lisp code
(use-package yasnippet
  :config
  (yas-global-mode 1)
  )

company

emacs-lisp code
(use-package company
  :init
  (setq
    ;;company-dabbrev-downcase nil
    company-idle-delay 0)
  :config
  (company-mode 1)
  (add-hook 'after-init-hook 'global-company-mode)
  (define-key company-active-map (kbd "C-h") nil)
  )

pdf-tools

emacs-lisp code
(use-package pdf-tools
  :mode (("\\.pdf\\'" . pdf-view-mode))
  :config
  (evil-collection-define-key 'normal 'pdf-view-mode-map
    "u" 'pdf-view-scroll-down-or-previous-page
    "d" 'pdf-view-scroll-up-or-next-page
    "J" 'pdf-view-next-page-command
    "K" 'pdf-view-previous-page-command
    "<right>" 'image-forward-hscroll
    "<left>" 'image-backward-hscroll
    (kbd "C-u") 'pdf-view-scroll-down-or-previous-page
    (kbd "C-d") 'pdf-view-scroll-up-or-next-page
    (kbd "C-s") 'pdf-occur
    )
  (add-hook 'pdf-view-mode-hook #'pdf-links-minor-mode)
  (setq pdf-annot-activate-created-annotations t)
  (setq pdf-annot-default-annotation-properties
        `((t (label . ,user-full-name))
          (text (icon . "Comment")
                (color . "#ff0000"))
          (highlight (color . "yellow"))
          (squiggly (color . "orange"))
          (strike-out(color . "red"))
          (underline (color . "blue"))))
  )

flyspell

emacs-lisp code
(use-package flyspell
  :straight nil
  :init
  (setq ispell-program-name "aspell")
  :config
  (add-hook 'org-mode-hook 'flyspell-mode)
  (add-hook 'message-mode-hook 'flyspell-mode)
  )
(use-package flyspell-correct-ivy
  :config
  (my-leader-def
    "sc" 'flyspell-correct-wrapper
    )
  )

which-key

emacs-lisp code
(use-package which-key
  :config
  (which-key-mode)
  )

magit

emacs-lisp code
(use-package magit
  :config
  (my-leader-def
   "g"  '(:ignore t :which-key "git")
   "gs" 'magit-status
   )
  (define-key magit-mode-map (kbd "C-<tab>") nil)
  (define-key magit-mode-map (kbd "M-<tab>") nil)
  )
(use-package evil-magit
  )

org

org

emacs-lisp code
(use-package org
  :straight org-plus-contrib
  :init
  (setq org-agenda-files (list "~/org/todo.org")
        org-agenda-span 10
        org-edit-src-content-indentation 0
        org-agenda-window-setup 'current-window
        org-startup-with-inline-images nil
        org-src-tab-acts-natively t
        org-adapt-indentation nil
        org-src-window-setup 'current-window
        org-export-with-smart-quotes t
        org-log-done t
        ;;org-src-window-setup 'other-window
        ;;org-export-in-background t
        org-startup-folded t
        org-highlight-latex-and-related '(native latex scripts entities)
        )
  ;; TODO: fix this so org-scheduled today actually applied correctly in org-faces.el
  ;; (- 1 (/ (float diff) (max wdays 0)))
  ;;   (upcoming? (and today? (> deadline today)))
  (setq org-deadline-warning-days 0)
  (setq org-agenda-deadline-faces '((1.01 . org-scheduled-previously)
                                    (1.0 . org-scheduled)
                                    (0.99 . org-sheduled-today)
                                    (0.0 . org-scheduled)))

  (setq org-confirm-babel-evaluate nil)
  ;; display/update images in the buffer after I evaluate
  (add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)

  :config
  (evil-define-key 'normal org-mode-map (kbd "RET") 'org-open-at-point)
  (add-to-list 'org-src-lang-modes '("conf" . conf))
  ;;(require 'ox-latex)
  ;;(require 'ox-beamer)
  ;;(setq org-export-allow-bind-keywords t)
  ;;(add-to-list 'org-latex-packages-alist '("" "minted")) added by custom instead
  ;;(ox-extras-activate '(ignore-headlines))
  (setq org-latex-listings 'minted)

  (setq org-latex-packages-alist '(("" "lmodern" nil)
                                   ("" "minted" nil)
                                   ("" "svg" nil)))
                                   ;;("margin=1in,headsep=0.4in,headheight=14pt" "geometry" nil)
                                   ;;("" "geometry" nil)
                                   ;;("" "fancyhdr" nil)
                                   ;;("" "parskip" nil)))
  ;;(setq org-file-apps
  ;;      '((auto-mode . emacs)
  ;;        ("\\.mm\\'" . default)
  ;;        ("\\.x?html?\\'" . default)
  ;;        ("\\.pdf\\'" . default)
  ;;        ("\\.png\\'" . "open \"%s\"")
  ;;        ("\\.svg\\'" . "open \"%s\"")))

  ;;(setq org-latex-pdf-process
  ;;      '("%latex -interaction nonstopmode -shell-escape -output-directory %o %f" "%latex -interaction nonstopmode -shell-escape -output-directory %o %f" "%latex -interaction nonstopmode -shell-escape -output-directory %o %f"))
  (setq org-latex-pdf-process (list "latexmk -shell-escape -bibtex -f -pdf %f"))
  (setq org-latex-table-scientific-notation "$%s\\times10^{%s}$")
  ;;(setq org-preview-latex-default-process 'imagemagick)
  (setq org-preview-latex-default-process 'dvisvgm
        org-preview-latex-image-directory "~/.cache/org-preview-latex/")

  (defun my-org-format-web-link ()
    (interactive)
    (let ((el (org-element-context)))
      (when (and (eq (org-element-type el) 'link)
                 (let ((type (org-element-property :type el)))
                   (or (string= type "http") (string= type "https"))))
        (let* ((url (org-element-property :raw-link el))
               (title (with-current-buffer (url-retrieve-synchronously url)
                        (dom-text
                         (dom-by-tag
                          (libxml-parse-html-region (point-min) (point-max))
                          'title)))))
          (delete-region (org-element-property :begin el)
                         (org-element-property :end el))
          (insert (org-link-make-string url title))))))

  (my-local-leader-def
   :keymaps 'org-mode-map
   "'" 'org-edit-special
   "c" 'org-capture

   "l" 'org-latex-export-to-pdf
   "h" 'org-latex-export-to-html

   ;; Clock
   ;; These keybindings should match those under the "aoC" prefix (below)
   "Cc" 'org-clock-cancel
   "Cd" 'org-clock-display
   "Ce" 'org-evaluate-time-range
   "Cg" 'org-clock-goto
   "Ci" 'org-clock-in
   "CI" 'org-clock-in-last
   "Cj" 'spacemacs/org-clock-jump-to-current-clock
   "Co" 'org-clock-out
   "CR" 'org-clock-report
   "Cr" 'org-resolve-clocks

   "dd" 'org-deadline
   "ds" 'org-schedule
   "dt" 'org-time-stamp
   "dT" 'org-time-stamp-inactive
   "ee" 'org-export-dispatch
   "fi" 'org-feed-goto-inbox
   "fu" 'org-feed-update-all

   "a" 'org-agenda

   "p" 'org-priority

   "Tc" 'org-toggle-checkbox
   "Te" 'org-toggle-pretty-entities
   "Ti" 'org-toggle-inline-images
   "Tl" 'org-toggle-link-display
   "Tt" 'org-show-todo-tree
   "TT" 'org-todo
   "TV" 'space-doc-mode
   "Tx" 'org-latex-preview
   ;;    "o" 'org-toggle-latex-fragment

   ;; More cycling options (timestamps, headlines, items, properties)
   "L" 'org-shiftright
   "H" 'org-shiftleft
   "J" 'org-shiftdown
   "K" 'org-shiftup

   ;; Change between TODO sets
   "C-S-l" 'org-shiftcontrolright
   "C-S-h" 'org-shiftcontrolleft
   "C-S-j" 'org-shiftcontroldown
   "C-S-k" 'org-shiftcontrolup

   ;; Subtree editing
   "sa" 'org-toggle-archive-tag
   "sA" 'org-archive-subtree
   "sb" 'org-tree-to-indirect-buffer
   "sh" 'org-promote-subtree
   "sj" 'org-move-subtree-down
   "sk" 'org-move-subtree-up
   "sl" 'org-demote-subtree
   "sn" 'org-narrow-to-subtree
   "sN" 'widen
   "sr" 'org-refile
   "ss" 'org-sparse-tree
   "sS" 'org-sort

   ;; tables
   "ta" 'org-table-align
   "tb" 'org-table-blank-field
   "tc" 'org-table-convert
   "tdc" 'org-table-delete-column
   "tdr" 'org-table-kill-row
   "te" 'org-table-eval-formula
   "tE" 'org-table-export
   "th" 'org-table-previous-field
   "tH" 'org-table-move-column-left
   "tic" 'org-table-insert-column
   "tih" 'org-table-insert-hline
   "tiH" 'org-table-hline-and-move
   "tir" 'org-table-insert-row
   "tI" 'org-table-import
   "tj" 'org-table-next-row
   "tJ" 'org-table-move-row-down
   "tK" 'org-table-move-row-up
   "tl" 'org-table-next-field
   "tL" 'org-table-move-column-right
   "tn" 'org-table-create
   "tN" 'org-table-create-with-table.el
   "tr" 'org-table-recalculate
   "ts" 'org-table-sort-lines
   "ttf" 'org-table-toggle-formula-debugger
   "tto" 'org-table-toggle-coordinate-overlays
   "tw" 'org-table-wrap-region

   ;; Source blocks / org-babel
   "bp" 'org-babel-previous-src-block
   "bn" 'org-babel-next-src-block
   "be" 'org-babel-execute-maybe
   "bo" 'org-babel-open-src-block-result
   "bv" 'org-babel-expand-src-block
   "bu" 'org-babel-goto-src-block-head
   "bg" 'org-babel-goto-named-src-block
   "br" 'org-babel-goto-named-result
   "bb" 'org-babel-execute-buffer
   "bs" 'org-babel-execute-subtree
   "bd" 'org-babel-demarcate-block
   "bt" 'org-babel-tangle
   "bf" 'org-babel-tangle-file
   "bc" 'org-babel-check-src-block
   "bj" 'org-babel-insert-header-arg
   "bl" 'org-babel-load-in-session
   "bi" 'org-babel-lob-ingest
   "bI" 'org-babel-view-src-block-info
   "bz" 'org-babel-switch-to-session
   "bZ" 'org-babel-switch-to-session-with-code
   "ba" 'org-babel-sha1-hash
   "bx" 'org-babel-do-key-sequence-in-edit-buffer
   "vk" 'org-babel-remove-result-one-or-many
   "vm" 'org-babel-mark-block

   ;; Multi-purpose keys
   "," 'org-ctrl-c-ctrl-c
   "*" 'org-ctrl-c-star
   "-" 'org-ctrl-c-minus
   "#" 'org-update-statistics-cookies
   "RET"   'org-ctrl-c-ret
   "M-RET" 'org-meta-return
   ;; attachments
   "A" 'org-attach
   ;; insertion
   "ib" 'org-insert-structure-template
   "id" 'org-insert-drawer
   "ie" 'org-set-effort
   "if" 'org-footnote-new
   "ih" 'org-insert-heading
   "iH" 'org-insert-heading-after-current
   "iK" 'spacemacs/insert-keybinding-org
   "il" 'org-insert-link
   "iL" 'org-ref-insert-link
   "in" 'org-add-note
   "ip" 'org-set-property
   "is" 'org-insert-subheading
   "it" 'org-set-tags-command
   "ii" 'my-org-format-web-link
   )

  (my-leader-def
   ;; org-agenda
   "ao#" 'org-agenda-list-stuck-projects
   "ao/" 'org-occur-in-agenda-files
   "aoa" 'org-agenda-list
   "aoc" 'org-capture
   "aoe" 'org-store-agenda-views
   "aofi" 'org-feed-goto-inbox
   "aofu" 'org-feed-update-all
   "aol" 'org-store-link
   "aom" 'org-tags-view
   "aoo" 'org-agenda
   "aos" 'org-search-view
   "aot" 'org-todo-list
   )
  )

ox-latex

emacs-lisp code
(use-package ox-latex
  :config
  (add-to-list 'org-latex-minted-langs '(ipython "python"))
  :straight nil
  )

TODO org-bullets

evil-org

emacs-lisp code
(use-package evil-org
  :after org
  :config
  (add-hook 'org-mode-hook 'evil-org-mode)
  (add-hook 'evil-org-mode-hook
            (lambda ()
              (evil-org-set-key-theme '(navigation insert textobjects additional
                                                   calendar todo))))
  (require 'evil-org-agenda)
  (evil-org-agenda-set-keys)
)

ob-ipython

emacs-lisp code
;(use-package ob-ipython
;  :config
;  (org-babel-do-load-languages
;   'org-babel-load-languages
;   '(
;     (shell . t)
;     (python . t)
;     (ipython . t)
;     (emacs-lisp . t)
;     (latex . t)
;     ))
;  )

jupyter

emacs-lisp code
; to build using straight on arm:
; cd ~/.emacs.d/straight/build/zmq
; nix-shell -p autoconf automake libtool pkg-config my-zeromq
; make
(use-package jupyter
  :config
  (org-babel-do-load-languages
   'org-babel-load-languages
   '(
     (shell . t)
     (python . t)
     (emacs-lisp . t)
     (latex . t)
     (jupyter . t) ; must be last
     ))
  )

htmlize

emacs-lisp code
(use-package htmlize
  )

org-ref

emacs-lisp code
(use-package org-ref
  :init
  (setq reftex-default-bibliography '("~/qnet/notebook/references.bib"))
  (setq org-ref-default-bibliography '("~/qnet/notebook/references.bib")
        org-ref-bibliography-notes "~/qnet/notebook/ref-notes.org"
        org-ref-pdf-directory "~/qnet/ref-pdfs/"
        doi-utils-download-pdf nil
        doi-utils-make-notes nil)
        ;;bibtex-completion-notes-path "~/qnet/ref-notes/ref-notes.org"
  (setq org-ref-completion-library 'org-ref-ivy-cite)
  )

org-pdftools

emacs-lisp code
(use-package org-pdftools
  :straight (org-pdftools :type git :host github :repo "fuxialexander/org-pdftools")
  :config (setq org-pdftools-root-dir "~/qnet/ref-pdfs/")
  (with-eval-after-load 'org
    (org-link-set-parameters "pdftools"
                             :follow #'org-pdftools-open
                             :complete #'org-pdftools-complete-link
                             :store #'org-pdftools-store-link
                             :export #'org-pdftools-export)
    (add-hook 'org-store-link-functions 'org-pdftools-store-link)))

LaTeX

emacs-lisp code
(use-package tex
  :straight auctex
  :defer t
  :init
  (setq TeX-view-program-selection '((output-pdf "pdf-tools")))
  (setq TeX-view-program-list '(("pdf-tools" "TeX-pdf-tools-sync-view")))
  (add-hook 'TeX-after-compilation-finished-functions
            #'TeX-revert-document-buffer)
;;(setq TeX-command-extra-options "\"-shell-escape\"")
;;(spacemacs/set-leader-keys-for-major-mode 'tex-mode
;;  "l" 'latex/build)
;;(spacemacs/set-leader-keys-for-major-mode 'latex-mode
;;  "l" 'latex/build)
  )

mu4e

emacs-lisp code
(add-to-list 'load-path "~/.nix-profile/share/emacs/site-lisp/mu4e/")
(use-package mu4e
  :straight nil
  :config
  ;(setq mu4e-mu-binary "/usr/local/share/emacs/site-lisp/mu/mu4e")

  (general-define-key
   :states 'normal
   :keymaps 'mu4e-view-mode-map
   "o" 'ace-link-mu4e
   "O" 'mu4e-view-open-attachment)

  (my-leader-def
   "am" 'mu4e
   )
  <<mu4e>>
  (require 'org-mu4e)
  )
(use-package mu4e-maildirs-extension
  :config
  (mu4e-maildirs-extension-load)
  )

TODO nix

fix this so nix-eshell works

emacs-lisp code
(use-package nix-mode
  )

smartparens and rainbow-delimiters

emacs-lisp code
(use-package smartparens
  :config
  (sp-local-pair 'org-mode "$" "$")
  (sp-local-pair 'org-mode '"\\[" "\\]")
  )
(use-package rainbow-delimiters
  :config
  (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
  )

column-enforce-mode

emacs-lisp code
(use-package column-enforce-mode
  :config
  (add-hook 'prog-mode-hook 'column-enforce-mode)
  (add-hook 'text-mode-hook 'column-enforce-mode)
  )
;;(require 'fill-column-indicator)
;;(add-hook 'prog-mode-hook 'turn-on-fci-mode)
;;(add-hook 'text-mode-hook 'turn-on-fci-mode)

frames and windows

emacs-lisp code
(setq split-height-threshold nil) ;80) ;40)
(setq split-width-threshold nil) ;160) ;100)

eshell

emacs-lisp code
(add-hook 'eshell-mode-hook
          '(lambda ()
             (define-key eshell-mode-map (kbd "<tab>") 'completion-at-point)))

(evil-define-key 'insert eshell-mode-map 
  (kbd "C-p") 'eshell-previous-input 
  (kbd "C-n") 'eshell-next-input)

comint

emacs-lisp code
(setq shell-default-height 40)
(setq shell-default-position 'full)
(setq shell-default-full-span nil)
(setq shell-default-term-shell "/usr/local/bin/bash")
;;(setq shell-default-shell 'shell)
(push (cons "\\*shell\\*" display-buffer--same-window-action) display-buffer-alist)
;;(setq term-color-black ((t (:foreground "dim gray"))))

(evil-define-key 'normal comint-mode-map (kbd "C-p") 'comint-previous-input
  (kbd "C-n") 'comint-next-input)
(evil-define-key 'insert comint-mode-map (kbd "C-p") 'comint-previous-input
  (kbd "C-n") 'comint-next-input)
(evil-define-key 'normal comint-mode-map (kbd "C-l") 'comint-clear-buffer)
(evil-define-key 'insert comint-mode-map (kbd "C-l") 'comint-clear-buffer)
(evil-define-key 'normal term-raw-map (kbd "C-p") 'term-send-up
  (kbd "C-n") 'term-send-down)
(evil-define-key 'insert term-raw-map (kbd "C-p") 'term-send-up
  (kbd "C-n") 'term-send-down)

(setq python-shell-interpreter "ipython"
      python-shell-interpreter-args "--simple-prompt")

(setq python-shell-prompt-detect-failure-warning nil)
;;(setq python-shell-completion-native-disabled-interpreters '("jupyter" "pypy"))

;;(add-hook 'shell-mode-hook 'my-shell-mode-hook)
;;(defun my-shell-mode-hook ()
;;  (setq comint-input-ring-file-name "~/.bash_history")
;;  (comint-read-input-ring t))
;;(defun my-shell-mode-hook ()
;;  (let ((histfile  "~/.bash_history"))
;;    (if (tramp-tramp-file-p default-directory)
;;        (let ((vec (tramp-dissect-file-name default-directory)))
;;          (setq comint-input-ring-file-name
;;                (tramp-make-tramp-file-name
;;                 (tramp-file-name-method vec)
;;                 (tramp-file-name-user vec)
;;                 (tramp-file-name-host vec)
;;                 histfile)))
;;      (setq comint-input-ring-file-name histfile)))
;;  (comint-read-input-ring t)
;;  (let ((process (get-buffer-process (current-buffer))))
;;    (set-process-sentinel process #'comint-write-input-ring)))

;; modifid from https://github.com/syl20bnr/spacemacs/issues/10956
;; (add-hook 'term-mode-hook
;;           (lambda ()
;;             (add-hook 'evil-normal-state-entry-hook
;;                       (lambda () (term-line-mode)) nil t)
;;             (add-hook 'evil-normal-state-exit-hook
;;                       (lambda () (term-char-mode)) nil t)))
(setq term-char-mode-point-at-process-mark nil)

libvterm

emacs-lisp code
; to build using straight:
; cd ~/.emacs.d/straight/build/vterm
; nix-shell -p cmake libvterm-neovim
; cmake -DUSE_SYSTEM_LIBVTERM=ON .
; make

(use-package vterm
)

tramp

emacs-lisp code
(use-package tramp
  :config
  (add-to-list 'tramp-remote-path 'tramp-own-remote-path)

  ;; for some reason (bug probably) this has to be here to reset tram-password-prompt-regexp
  (setq tramp-password-prompt-regexp
        (format "^.*\\(%s\\).*:\^@? *" (regexp-opt password-word-equivalents)))

  :straight nil
  )

(setq password-word-equivalents (cons "token_response" password-word-equivalents))

;;(setq tramp-histfile-override t nil (tramp))

this fixes an issue where you get the error: ppwd: command not found only on macos?

lua

emacs-lisp code
(use-package lua-mode
  :config
  )

json

emacs-lisp code
(use-package json-mode
  :config
  )

hidden-mode-line

https://emacs-doctor.com/emacs-hide-mode-line.html

emacs-lisp code
(defvar-local hidden-mode-line-mode nil)

(define-minor-mode hidden-mode-line-mode
  "Minor mode to hide the mode-line in the current buffer."
  :init-value nil
  :global t
  :variable hidden-mode-line-mode
  :group 'editing-basics
  (if hidden-mode-line-mode
      (setq hide-mode-line mode-line-format
            mode-line-format nil)
    (setq mode-line-format hide-mode-line
          hide-mode-line nil))
  (force-mode-line-update)
  ;; Apparently force-mode-line-update is not always enough to
  ;; redisplay the mode-line
  (redraw-display)
  (when (and (called-interactively-p 'interactive)
             hidden-mode-line-mode)
    (run-with-idle-timer
     0 nil 'message
     (concat "Hidden Mode Line Mode enabled.  "
             "Use M-x hidden-mode-line-mode to make the mode-line appear."))))

;; If you want to hide the mode-line in every buffer by default
;; (add-hook 'after-change-major-mode-hook 'hidden-mode-line-mode)

brightness

https://github.com/dakra/xbacklight ;;(use-package xbacklight ;; :straight (xbacklight :type git :host github :repo “dakra/xbacklight”) ;;) https://github.com/DamienCassou/desktop-environment (setq brightness-delta “10%”) (setq brightness-get-cmd “light”) (setq brightness-get-regexp “\\([0-9]+%\\)”) (setq brightness-set-cmd “light set %s”)

(defun brightness-get () (let ((output (shell-command-to-string brightness-get-cmd))) (save-match-data (string-match brightness-get-regexp output) (match-string 1 output))))

(defun brightness-set (value) (shell-command-to-string (format brightness-set-cmd value)) (message “New brightness value: %s” (brightness-get)))

(defun brightness-inc () (interactive) (brightness-set (concat brightness-delta “+”)))

(defun brightness-dec () (interactive) (brightness-set (concat brightness-delta “-”)))

emacs-lisp code
(defun brightness-get ()
  (interactive)
  (message "Brightness:  %s%%" 
           (string-trim (shell-command-to-string "light") "%")))

(defun brightness-inc ()
  (interactive)
  (shell-command-to-string "light -A 5")
  (brightness-get))

(defun brightness-dec ()
  (interactive)
  (shell-command-to-string "light -U 5")
  (brightness-get))

exwm

https://github.com/timor/spacemacsOS

emacs-lisp code
(use-package pulseaudio-control
  :init
  (setq pulseaudio-control-volume-step "5%")
  :config
  (my-leader-def
    "ap" 'pulseaudio-control-map
    )
  )

(use-package exwm
;;  :straight nil
  :init
  (setq use-dialog-box nil)
  (setq exwm-workspace-show-all-buffers t)
  (setq exwm-layout-show-all-buffers t)
  (evil-set-initial-state 'exwm-mode 'emacs)
  (setq my-window-resize-delta 2)
  (setq lockcmd "i3lock -i /home/akyle/Downloads/outrun.png")
  ;;(setq exwm-workspace-minibuffer-position 'bottom)

  ;;(setenv "EDITOR" "emacsclient") set in xinitrc

  :config
  ;;(add-hook 'exwm-mode-hook #'hidden-mode-line-mode)

  ;;(my-leader-def
  ;;  "e" '(lambda () (interactive) (xcb:ewmh:set-_NET_WM_DESKTOP)))

  ;; All buffers created in EXWM mode are named "*EXWM*". You may want to
  ;; change it in `exwm-update-class-hook' and `exwm-update-title-hook', which
  ;; are run when a new X window class name or title is available.  Here's
  ;; some advice on this topic:
  ;; + Always use `exwm-workspace-rename-buffer` to avoid naming conflict.
  ;; + For applications with multiple windows (e.g. GIMP), the class names of
  ;;    all windows are probably the same.  Using window titles for them makes
  ;;   more sense.
  ;; In the following example, we use class names for all windows expect for
  ;; Java applications and GIMP.
  ;;(add-hook 'exwm-update-class-hook
  ;;          (lambda ()
  ;;            (unless (or (string-prefix-p "sun-awt-X11-" exwm-instance-name)
  ;;                        (string= "gimp" exwm-instance-name))
  ;;              (exwm-workspace-rename-buffer exwm-class-name))))
  ;;(add-hook 'exwm-update-title-hook
  ;;          (lambda ()
  ;;            (when (or (not exwm-instance-name)
  ;;                      (string-prefix-p "sun-awt-X11-" exwm-instance-name)
  ;;                      (string= "gimp" exwm-instance-name))
  ;;              (exwm-workspace-rename-buffer exwm-title))))

  (defun my-exwm-rename ()
    (exwm-workspace-rename-buffer (concat exwm-class-name ": " exwm-title)))

  (add-hook 'exwm-update-class-hook 'my-exwm-rename)
  (add-hook 'exwm-update-title-hook 'my-exwm-rename)

  ;;(add-hook 'exwm-update-title-hook 
  ;;          (lambda () 
  ;;            (if (and (string= "Firefox" exwm-class-name)
  ;;                     (not (string= "Mozilla Firefox" exwm-title)))
  ;;                ;;(exwm-workspace-rename-buffer (substring exwm-title 0 -18))
  ;;                (exwm-workspace-rename-buffer exwm-title)
  ;;              (exwm-workspace-rename-buffer exwm-title))))
  ;;;; Quick swtiching between workspaces
  ;;(defvar exwm-toggle-workspace 0
  ;;  "Previously selected workspace. Used with `exwm-jump-to-last-exwm'.")
  ;;(defun exwm-jump-to-last-exwm ()
  ;;  (interactive)
  ;;  (exwm-workspace-switch exwm-toggle-workspace))
  ;;(defadvice exwm-workspace-switch (before save-toggle-workspace activate)
  ;;  (setq exwm-toggle-workspace exwm-workspace-current-index))

  (setq touchpad-is-enabled t)
  (defun toggle-touchpad ()
    (interactive)
    (if touchpad-is-enabled
        (progn
          (shell-command "xinput disable 'Pine64 Pinebook Pro Touchpad'")
          (setq touchpad-is-enabled nil))
      (progn
        (shell-command "xinput enable 'Pine64 Pinebook Pro Touchpad'")
        (setq touchpad-is-enabled t))))

  (general-define-key :keymaps 'override "<f7>" 'toggle-touchpad)

  (define-key exwm-mode-map (kbd "C-c") nil)

  (add-to-list 'exwm-input-prefix-keys (kbd "C-SPC"))

  (setq exwm-input-global-keys
        `(
          ([?\s-r] . exwm-reset)
          ;;(,(kbd "C-SPC") . my-leader-prefix-cmd)
          ([?\s-f] . exwm-layout-toggle-fullscreen)
          ([?\s-F] . exwm-layout-toggle-mode-line)
          ([?\s-x] . exwm-workspace-switch)
          ;;([s-tab] . exwm-jump-to-last-exwm)
          ;;(,(kbd "M-<tab>") . exwm-jump-to-last-exwm)
          ;;(,(kbd "M-<tab>") . toggle-window-split)
          ;;(,(kbd "C-<tab>") . (lambda () (interactive) (switch-to-buffer nil)))
          ;;([?\s-b] . switch-to-buffer)
          ;;([?\s-o] . find-file)
          ;;(,(kbd "<f8>") . toggle-touchpad)

          ;;,@(mapcar (lambda (i)
          ;;            `(,(kbd (format "s-%d" i)) .
          ;;              (lambda ()
          ;;                (interactive)
          ;;                (exwm-workspace-switch-create ,i))))
          ;;          (number-sequence 0 9))

          ;; Bind "s-m" to launch applications ('M-&' also works if the output
          ;; buffer does not bother you).
          ;;(,(kbd "s-m") . counsel-linux-app)

          ;;;; Focusing windows
          ;;(,(kbd "s-h") . evil-window-left)
          ;;(,(kbd "s-j") . evil-window-down)
          ;;(,(kbd "s-k") . evil-window-up)
          ;;(,(kbd "s-l") . evil-window-right)
          ;;;; Moving Windows
          ;;(,(kbd "s-H") . evil-window-move-far-left)
          ;;(,(kbd "s-J") . evil-window-move-very-bottom)
          ;;(,(kbd "s-K") . evil-window-move-very-top)
          ;;(,(kbd "s-L") . evil-window-move-far-right)
          ;;;; Resize
          ;;(,(kbd "M-s-h") . (lambda () (interactive) (shrink-window my-window-resize-delta t)))
          ;;(,(kbd "M-s-j") . (lambda () (interactive) (shrink-window my-window-resize-delta)))
          ;;(,(kbd "M-s-k") . (lambda () (interactive) (enlarge-window my-window-resize-delta)))
          ;;(,(kbd "M-s-l") . (lambda () (interactive) (enlarge-window my-window-resize-delta t)))
          (,(kbd "<XF86MonBrightnessDown>") . brightness-dec)
          (,(kbd "<XF86MonBrightnessUp>") . brightness-inc)
          (,(kbd "<XF86AudioMute>") . pulseaudio-control-toggle-current-sink-mute)
          (,(kbd "<XF86AudioLowerVolume>") . pulseaudio-control-decrease-volume)
          (,(kbd "<XF86AudioRaiseVolume>") . pulseaudio-control-increase-volume)
          (,(kbd "s-<escape>") . (lambda () (interactive) (shell-command lockcmd)))
          ;(,(kbd "s-t") . (lambda () (interactive) (start-process "firefox" nil "firefox")))
          ))

  (setq my-global-simulation-keys 
        `(
          (,(kbd "C-b") . ,(kbd "<left>"))
          (,(kbd "C-f") . ,(kbd "<right>"))
          (,(kbd "C-p") . ,(kbd "<up>"))
          (,(kbd "C-n") . ,(kbd "<down>"))
          (,(kbd "C-a") . ,(kbd "<home>"))
          (,(kbd "C-e") . ,(kbd "<end>"))
          (,(kbd "C-h") . ,(kbd "<backspace>"))
          ;;(,(kbd "s-t") . ,(kbd "C-t"))
          ;;(,(kbd "s-c") . ,(kbd "C-c"))
          ;;(,(kbd "s-v") . ,(kbd "C-v"))
          ;;(,(kbd "s-w") . ,(kbd "C-w"))
          ;;(,(kbd "s-q") . ,(kbd "C-q"))
          ;;(,(kbd "s-n") . ,(kbd "C-n"))
          (,(kbd "C-j") . ,(kbd "C-<prior>"))
          (,(kbd "C-k") . ,(kbd "C-<next>"))
          ))

  (setq exwm-input-simulation-keys my-global-simulation-keys)

  ;;(setq my-firefox-simulation-keys
  ;;      (append my-global-simulation-keys
  ;;              `(
  ;;                ;;(,(kbd "s-<tab>") . ,(kbd "C-<tab>"))
  ;;                ;;(,(kbd "s-<tab>") . ,(kbd "^")) ; works with vimperator
  ;;                (,(kbd "s-<tab>") . ,(kbd "C-6")) ; works with tridactyl
  ;;                (,(kbd "C-s") . ,(kbd "C-g")) ; works with tridactyl
  ;;                (,(kbd "C-S-s") . ,(kbd "C-S-g")) ; works with tridactyl
  ;;                )))

  ; c-tab seem like it just wont work given emacs' limitations
  ; exwm-input--fake-key:       id=#x1000037 event=C-tab keycode
  ;[[file:/nix/store/b011yv21rbqr7a35m1prl4jk44cybwxl-emacs-exwm-0.22.1/share/emacs/site-lisp/elpa/exwm-0.22.1/exwm-input.el::(make-instance class]] 
  ; https://emacs.stackexchange.com/questions/52752/how-to-use-unbound-keys-as-non-sticky-modifier-keys

  ;(setq exwm-manage-finish-hook nil)
  ;;(add-hook 'exwm-manage-finish-hook
  ;;        (lambda ()
  ;;          (when (and exwm-class-name
  ;;                     (string= exwm-class-name "Firefox"))
  ;;            (exwm-input-set-local-simulation-keys my-firefox-simulation-keys))))

  ;;(require 'subr-x)  ;; Because of when-let

  ;;(defvar exwm-workspace-window-assignments
  ;;  '(("Firefox" . 0))
  ;;  "An alist of window classes and which workspace to put them on.")

  ;;(add-hook 'exwm-manage-finish-hook
  ;;          (lambda ()
  ;;            (when-let ((target (cdr (assoc exwm-class-name exwm-workspace-window-assignments))))
  ;;              (exwm-workspace-move-window target))))


  ;;(defun my-startup-processes ()
  ;;  (start-process "firefox" nil "firefox")
  ;;  ;;(start-process "calendar" nil "gnome-calendar")
  ;;  )
  ;(add-hook 'exwm-init-hook 'my-startup-processes)

  ;;(defun my-startup-layout ()
  ;;  (interactive)
  ;;  (switch-to-buffer "Firefox")
  ;;  (exwm-workspace-move-window 9)
  ;;  (switch-to-buffer "Gnome-calendar")
  ;;  (exwm-workspace-move-window 8)
  ;;  (exwm-workspace-switch 0)
  ;;  (split-window-right)
  ;;  (setq current-prefix-arg '(4))
  ;;  (call-interactively 'spacemacs/default-pop-shell)
  ;;  (evil-normal-state)
  ;;  (evil-emacs-state)
  ;;  (other-window 1)
  ;;  (org-agenda-list))

  (exwm-enable)

  ;;(require 'exwm-randr)
  ;;(setq exwm-randr-workspace-output-plist '(0 "VGA1"))
  ;;(add-hook 'exwm-randr-screen-change-hook
  ;;          (lambda ()
  ;;            (start-process-shell-command
  ;;             "xrandr" nil "xrandr --output VGA1 --left-of LVDS1 --auto")))
  ;;(exwm-randr-enable)
  ;;(server-start) ; start emacsclient for xdg-open of pdfs from firefox
  )

minibuffer-statusbar

emacs-lisp code
(use-package minibuffer-statusbar
  :straight (minibuffer-statusbar :type git :host github 
                                  :repo "akirakyle/minibuffer-statusbar")
  :config
  (minibuffer-statusbar-mode t)
  (global-eldoc-mode -1))

xinitrc

bash code
#setxkbmap -layout us -model apple-laptop -variant dvorak -option caps:ctrl_modifier ctrl:ralt_rctrl
#xset m 100 1
#polybar bar &
# https://github.com/myfreeweb/evscript
# https://gitlab.com/interception/linux/plugins/caps2esc
#xcape -e 'Control_L=Escape'
#xcape -e Caps_Lock=Escape
#libinput-gestures &
xset r rate 150 50
export EDITOR=emacsclient
export PAN_MESA_DEBUG=gles3
export MOZ_USE_XINPUT2=1
export GTK_THEME=Adwaita:dark
xsetroot -cursor_name left_ptr
exec emacs
#exec ~/git/emacs/emacs-build/src/emacs

snippets

org-mode

snippet code
# -*- mode: snippet -*-
# name: general block
# key: 
# --
#+BEGIN_${1:SRC$(upcase yas-text)}
$0
#+END_$1
snippet code
# -*- mode: snippet -*-
# name: general block
# key: bl
# --
#+begin_${1:src}$2
$0
#+end_$1
snippet code
# -*- mode: snippet -*-
# name: ipython block
# key: py
# --
#+begin_src ipython :session ${1::file ${2:./`(file-relative-name (let ((temporary-file-directory "./figs/")) (make-directory temporary-file-directory t) (make-temp-file "ipy" nil ".svg")))`}} :exports ${3:both}
$0
#+end_src
snippet code
# -*- mode: snippet -*-
# name: ipython block
# key: py
# --
#+begin_src ipython :session ${1::ipyfile ${2:} }:exports ${3:both }:results ${4:raw drawer}
$0
#+end_src
snippet code
# -*- mode: snippet -*-
# name: python block
# key: py
# --
#+begin_src jupyter-python
$0
#+end_src
snippet code
# -*- mode: snippet -*-
# name: latex block
# key: beg
# --
\begin{${1:align*}}
$0
\end{$1}
snippet code
# -*- mode: snippet -*-
# name: matplotlib imports
# key: mpl
# --
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
%config InlineBackend.figure_format = 'svg'
Email: akira@akirakyle.com
GPG Public Key: 963C 2413 0BD3 BF1B 624C EF4C 8850 284C 20B8 078D