SkillAgentSearch skills...

Dotfiles

Configuration files for XMonad, Emacs, NixOS, Taffybar and more.

Install / Use

/learn @colonelpanic8/Dotfiles

README

-- mode: org; --

[[https://github.com/colonelpanic8/dotfiles/actions/workflows/gh-pages.yml][https://github.com/colonelpanic8/dotfiles/actions/workflows/gh-pages.yml/badge.svg?branch=master]]

This document is best read at [[http://ivanmalison.github.io/dotfiles/]] or, of course, in emacs, as the internal links that follow are unlikely to work anywhere else (including, for example, at https://github.com/IvanMalison/dotfiles).

  • About This is my emacs configuration in literate form. It aspires to be like the incredibly well commented literate configurations of [[http://pages.sachachua.com/.emacs.d/Sacha.html][Sacha Chua]] and [[http://doc.rix.si/cce/cce.html][Ryan Rix]], but I haven't quite gotten around to polishing it to the point that those two have. Still, there are definitely a few sections of which I am quite proud, and that others may find to be useful.
  • Highlights These sections are the ones that have the most potential to be interesting to others: ** How I generate http://ivanmalison.github.io/dotfiles/ *** org-export **** GitHub Actions [[https://github.com/IvanMalison/dotfiles/tree/master/gen-gh-pages][This directory]] contains a collection of scripts that export this org document to html. A [[https://github.com/IvanMalison/dotfiles/blob/master/.github/workflows/gh-pages.yml][GitHub Actions workflow]] runs on every push to master, generating the HTML and deploying it to GitHub Pages. *** [[https://github.com/fniessen/org-html-themes][Read The Org]] I use [[https://github.com/fniessen][fniessen]]'s ReadTheOrg theme which can be found at https://github.com/fniessen/org-html-themes. *** Predictable and Human Readable Heading Links To make it so that internal heading links have names that correspond to the heading text, and don't change when new headings are added to the document, I wrote a custom version of ~org-export-get-reference~.

See how [[http://ivanmalison.github.io/dotfiles/#usemyowndefaultnamingschemefororgheadings][this link]] (which is just a normal internal link in the original document) takes you to http://ivanmalison.github.io/dotfiles/#usemyowndefaultnamingschemefororgheadings.

In case you haven't noticed, that is where you should go grab the code that does this.

I'm considering turning this snippet in to a package, so please let me know if that is something you are interested in. *** [[Add link icons in headings that lead to themselves][Add link icons in headings that lead to themselves]] This is another pretty nasty hack. This is useful when you are browsing the document and you want to grab a link to the current heading. *** Set Background Color Source Blocks For some reason, org-mode uses all of your currently active fontification when exporting EXCEPT for background color. [[Set Background Color of Source Blocks for Export][This]] modification fixes this. ** [[frame-mode][Custom frame control]] My custom [[frame-mode][frame-mode]] stuff is built to integrate really nicely with xmonad. I think its pretty awesome! ** [[Functions][My functions section]] ...has a bunch of generally useful functions:

  • [[https://github.com/IvanMalison/emit/blob/2e4d788abd68bac538acb06443179b8d5885052e/emit.el#L104][emit-prefix-selector]] (SUPER USEFUL, moved to emit) See [[https://github.com/IvanMalison/emit#prefix-selector][README]] for explantion
  • [[Font Size][Font Size]] functions and an [[fontsizehydra][Awesome Hydra]] for them
  • [[downloadfile][Download a file into a buffer]] (curl straight into a file)
  • [[editscript][Edit a script on $PATH]]
  • [[Copy/Yanking][Copy Portions of Buffer File Path Hydra]] and the associated [[Copy/Yank String Functions][Copy String Functions]]
  • [[namedbuild][Named Build of Builder Macros]] ([[https://github.com/IvanMalison/emit#named-builder][README]]) and [[composemacros][A Compose Supporting Macros]] ([[https://github.com/IvanMalison/emit#compose][README]])
  • [[Add a blacklist to a major mode]] ** Configuration of My Own Packages
  • [[term-projectile][term-projectile]] and [[term-manager][term-manager]]
  • [[org-projectile][org-projectile]]
  • [[multi-line][multi-line]]
  • [[github-search][github-search]]
  • [[flimenu][flimenu]]
  • [[frame-mode][frame-mode]]
  • [[tile][tile]] ** [[programminglanguages][Programming Language Configurations]] My programming language major mode configurations can all be found [[programminglanguages][here]]. ** [[org][org-mode]] My [[org][org-mode]] configuration is pretty comprehensive, but not super well commented.
  • HTML Headers #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/htmlize.css"/> #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/>

#+HTML_HEAD: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> #+HTML_HEAD: <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> #+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js"></script> #+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>

  • Early The configurations in this section need to occur early in emacs startup for some reason or another. ** Lexical Binding This makes it so that the file that is produced from tangling this file uses lexical scoping. #+BEGIN_SRC emacs-lisp ;;; -- lexical-binding: t -- (setq-default lexical-binding t) #+END_SRC ** Security #+BEGIN_SRC emacs-lisp (defvar imalison:secure t)

(defun imalison:use-https-and-tls () (setq tls-checktrust t) (let ((trustfile (replace-regexp-in-string "\\" "/" (replace-regexp-in-string "\n" "" (shell-command-to-string "python -m certifi"))))) (setq tls-program (list (format "gnutls-cli%s --x509cafile %s -p %%p %%h" (if (eq window-system 'w32) ".exe" "") trustfile)))))

(defun imalison:test-security () (interactive) (let ((bad-hosts (loop for bad in `("https://wrong.host.badssl.com/" "https://self-signed.badssl.com/") if (condition-case _e (url-retrieve bad (lambda (_retrieved) t)) (error nil)) collect bad))) (if bad-hosts (error (format "tls misconfigured; retrieved %s ok" bad-hosts)) (url-retrieve "https://badssl.com" (lambda (_retrieved) t)))))

(when imalison:secure (imalison:use-https-and-tls)) #+END_SRC ** Setup auto-compile #+BEGIN_SRC emacs-lisp (use-package auto-compile :demand t :config (progn (auto-compile-on-load-mode) (auto-compile-on-save-mode))) #+END_SRC ** Prefer Newer Versions To reduce the risk of loading outdated byte code files, we set load-prefer-newer and enable auto-compile-on-load-mode as early as possible. #+BEGIN_SRC emacs-lisp (setq load-prefer-newer t) #+END_SRC ** Custom Files The default value of ~custom-file~ is just the current user's ~.emacs.d/init.el~ file. Emacs will add content to ~custom-file~ whenever a variable is customized or marked as safe. When init.el is version controlled, it is quite annoying to have random machine-generated variable settings added to it because those changes are often not worth keeping permanently, so we set a different custom file here to avoid this situation.

custom-before.el is loaded before the rest of init.el, while custom-after.el is loaded afterwards. this-machine.el has customizations that should only apply to the current machine. custom-before and custom-after are not version controlled in the dotfiles repo but they are shared across machines elsewhere. #+BEGIN_SRC emacs-lisp (defvar machine-custom "~/.emacs.d/this-machine.el") (defvar custom-after-file "~/.emacs.d/custom-after.el") (setq custom-file "~/.emacs.d/custom-before.el") (when (file-exists-p custom-file) (load custom-file)) #+END_SRC ** Benchmarking This appears here so that it can accurately benchmark as much of startup as possible. #+BEGIN_SRC emacs-lisp (defvar imalison:do-benchmark)

(when user-init-file (let ((bench-file (concat (file-name-directory user-init-file) "benchmark.el"))) (when (file-exists-p bench-file) (load bench-file))))

(use-package benchmark-init :if imalison:do-benchmark :demand t :config (setq max-specpdl-size 99999999)) #+END_SRC ** GUI Disables Death to any gui elements in emacs! Do this EARLY so that emacs doesn't redisplay in a way that is visually unpleasant on startup a bunch of times. #+BEGIN_SRC emacs-lisp (when (fboundp 'menu-bar-mode) (menu-bar-mode -1)) (when (fboundp 'tool-bar-mode) (tool-bar-mode -1)) (when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) #+END_SRC Tooltips are annoying: #+BEGIN_SRC emacs-lisp (if (fboundp 'tooltip-mode) (tooltip-mode -1) (setq tooltip-use-echo-area t))' #+END_SRC ** Byte-Compiler These definitions silence the byte-compiler. #+BEGIN_SRC emacs-lisp (defvar grep-find-ignored-directories nil) (defvar grep-find-ignored-files nil) (defvar ido-context-switch-command nil) (defvar ido-cur-item nil) (defvar ido-cur-list nil) (defvar ido-default-item nil) (defvar inherit-input-method nil) (defvar oauth--token-data nil) (defvar tls-checktrust nil) (defvar tls-program nil) (defvar url-callback-arguments nil) (defvar url-callback-function nil) (defvar url-http-extra-headers nil) #+END_SRC

#+BEGIN_SRC emacs-lisp ;; This variable doesn't exist in old versions of org-mode (defvar org-show-context-detail) #+END_SRC ** exec-path-from-shell Sets environment variables by starting a shell. #+BEGIN_SRC emacs-lisp (use-package exec-path-from-shell :disabled (not (equal system-type 'darwin)) :config (progn ;; For debugging (when nil (message "path: %s, setup: %s" (getenv "PATH") (getenv "ENVIRONMENT_SETUP_DONE")) (setq exec-path-from-shell-

View on GitHub
GitHub Stars210
CategoryDevelopment
Updated9d ago
Forks21

Languages

Nix

Security Score

85/100

Audited on Mar 14, 2026

No findings