Welcome to JMacs! This is a my personal configuration of emacs, for solo RPG campaigns like Ironsworn, writing (both prose and code), and for general use. I have organized this file into different sections, such as the functions I use, the UI settings, etc.
By default, I want to use straight.el as my package manager.
(setq package-enable-at-startup nil)
I am using straight.el for my packages.
(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))
Use-package provides an easy-to-use macro - I like that, but want the functionality of straight.el.
(straight-use-package 'use-package)
And finally, I always want it to use straight.el.
(setq straight-use-package-by-default t)
I want to use the newest version of org-mode instead of the one built in to emacs.
(straight-use-package '(org-plus-contrib :includes org))
And finally, I want to load the literate config.
(org-babel-load-file "~/.emacs.d/jmacs.org")
This is where I setup my initial personal information, as well as a minimal UI and enabling the visual bell.
(setq visible-bell t)
Now I want to disable automatic indentation with electric-indent-mode, and disable tabs.
(electric-indent-mode -1)
(setq-default indent-tabs-mode nil)
(setq tab-always-indent 'complete)
Undo Tree lets me use more of Evil mode’s redo functionality.
(use-package undo-tree
:config
(global-undo-tree-mode))
Evil mode lets me use the (superior) Vim bindings to the Emacs ones. In addition, I don’t want :q to kill emacs, but rather the current buffer I am in (similar to Vim).
This is the core of evil mode.
(use-package evil
:init
(setq evil-undo-system 'undo-tree)
(setq evil-want-integration t) ;; This is optional since it's already set to t by default.
(setq evil-want-keybinding nil)
:config
;(evil-set-undo-system 'undo-tree)
;(setq evil-undo-system 'undo-tree)
(evil-mode 1)
:preface
(defun ian/save-and-kill-this-buffer ()
(interactive)
(save-buffer)
(kill-this-buffer))
:config
(with-eval-after-load 'evil-maps ; avoid conflict with company tooltip selection
(define-key evil-insert-state-map (kbd "C-n") nil)
(define-key evil-insert-state-map (kbd "C-p") nil))
(evil-ex-define-cmd "q" #'kill-this-buffer)
(evil-ex-define-cmd "wq" #'ian/save-and-kill-this-buffer))
This provides a collection of modules for using evil mode in other emacs programs.
(use-package evil-collection
:after evil
:config
(evil-collection-init))
(use-package general)
Which-key lets me see what keybindings I can use.
(use-package which-key
:config
(which-key-mode 1))
I want to use hydras for certain things - namely, elfeed filters.
(use-package hydra)
Helpful allows me to have a better view of a help buffer.
(use-package helpful
:config
(setq counsel-describe-function-function #'helpful-callable)
(setq counsel-describe-variable-function #'helpful-variable))
(use-package counsel
:config
(counsel-mode 1))
(use-package ivy
:defer 0.1
:diminish
:config
(setq ivy-count-format "(%d/%d) ")
(ivy-mode 1))
Ivy Posframe makes it much easier to edit the ivy ui.
Ivy Rich will allow me to see more about each command
(use-package ivy-rich
:init
(ivy-rich-mode 1))
(use-package swiper
:after ivy)
I like having different colors for faces.
(set-face-attribute 'org-level-1 nil :foreground "#83a598")
(set-face-attribute 'org-level-2 nil :foreground "#d3869b")
(set-face-attribute 'org-level-3 nil :foreground "#fabd2f")
(set-face-attribute 'org-level-4 nil :foreground "#fb4934")
(set-face-attribute 'org-level-5 nil :foreground "#83a598")
(set-face-attribute 'org-level-6 nil :foreground "#d3869b")
(set-face-attribute 'org-level-7 nil :foreground "#fabd2f")
(set-face-attribute 'org-level-8 nil :foreground "#fb4934")
Org Tempo lets me use <s(tab) to insert blocks into an org-mode document.
(use-package org-tempo
:straight nil
:ensure nil)
I love Iosevka as a font. All the different variants help as well.
(set-face-attribute 'default nil :font "Iosevka Nerd Font" :height 120)
(set-face-attribute 'org-meta-line nil :font "Iosevka Nerd Font" :height 120)
(set-face-attribute 'org-block nil :font "Iosevka Nerd Font" :height 120)
I like Iosevka Aile as a variable width font for content.
(set-face-attribute 'variable-pitch nil :font "Iosevka Aile" :height 120)
The doom-themes collection has a lot of nice themes - I do overwrite some of the faces, though.
(use-package doom-themes)
(load-theme 'doom-gruvbox t)