This is the code that defines all user interfaces except for those directly related to my memex or
| Dependency | Description |
|---|---|
| doom-themes | A package for creating and using themes. |
| doom-modeline | Modelines for doom emacs. |
| solaire-mode | Changes colors on non-file buffers. |
| ivy | Improves a lot of the UI features of Emacs. |
| counsel | Adds improved UI customizations. |
| swiper | Better search engine. |
| ivy-rich | Adds comments to ivy functions. |
| posframe | Dependency for posframe functions. |
| ivy-posframe | Adds posframe popups to Ivy. |
| hydra | Adds hydras, nice looking UI popups. |
| hydra-posframe | POS-ifys hydras. |
| which-key | Tell me what the keys do. |
| rainbow-delimiters | Make delimeters pretty. |
| ace-window | Better jumping between windows. |
| flyspell-correct | A good, very effective spell checker. |
(ec-load-deps deps)I like to use ivy-mode to make my text editor feel better and be more useful, so I add it.
(setq ivy-height 20)
(ivy-mode)| Variable | Value | Description |
|---|---|---|
| ivy-posframe-min-height | nil | |
| ivy-posframe-height | nil | |
| ivy-posframe-min-width | 100 | Makes the width of the posframe reasonable. |
| ivy-posframe-border-width | 5 |
Now that we have the variables, we can actually set everything up with reckless abandon.
(ec-set-variables vars)
(setq ivy-posframe-display-functions-alist
'((swiper-isearch . ivy-posframe-display-at-window-bottom-left)
(ec-searcan auditory bell, soh-interactively . ivy-posframe-display-at-window-bottom-left)
(w3m-browse-url . ivy-posframe-display-at-window-bottom-left)
(flyspell-correct-ivy . ivy-posframe-display-at-point)
(t . ivy-posframe-display)))
(setf (alist-get 'ivy-completion-in-region ivy-posframe-display-functions-alist)
'ivy-posframe-display-at-point)
(setq ivy-posframe-height ivy-height)
;; size it to the same thing as ivy posframe each time
(setq ivy-posframe-size-function
(defun ivy-posframe-get-size+ ()
(if (eq ivy--display-function
'ivy-posframe-display-at-point)
(list
:min-height ivy-posframe-height
:min-width 80)
(list
:min-height ivy-posframe-height
:min-width (+ 2 (frame-width))))))
(ivy-posframe-mode +1)Finally, we also include hydra-posframe related features, which makes our hydras look nicer.
(setq hydra-posframe-border-width 5)
(hydra-posframe-mode +1)This first sets the primary key to M-o, which makes it easier to jump about.
(global-set-key (kbd "M-o") 'ace-window)Then I also change the keys ot be alphanumeric.
(setq aw-keys '(?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m ?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z))(define-key flyspell-mode-map (kbd "C-:") 'flyspell-correct-previous)
(add-hook 'org-mode-hook #'flyspell-mode)
(add-hook 'prog-mode-hook #'flyspell-mode)there is no reazon
Navagating lisp sucks with a simple sea of parens, so let’s break that up into a sea of subtly different colored parens.
(setq rainbow-delimiters-max-face-count 2)
(add-hook 'prog-mode-hook (lambda () (rainbow-delimiters-mode +1)))
(rainbow-delimiters-mode +1)To make the Emacs configuration a little more modern (and minimal) I remove the scrollbar, splash screens, and set the mini-window height.
;; Remove Scrollbar
(scroll-bar-mode -1)
;; Remove Tool Bar
(tool-bar-mode -1)
;; Remove Menubar
(menu-bar-mode -1)
;; Remove Tooltips
(tooltip-mode -1)
;; add visual lines for everything
(global-visual-line-mode t)
;; wrap words, but also kill the entire line
(setq-default word-wrap t)
;; y or n instead of yes or no
(fset 'yes-or-no-p 'y-or-n-p)
;; make the cursor a bar, which is more modern
(setq-default cursor-type '(bar . 2))| Variable | Value | Description |
|---|---|---|
| max-mini-window-height | 1.0 | Make minibuffer height reasonable. |
| inhibit-startup-message | t | Clear away startup nonsense. |
| inhibit-startup-screen | t | ” |
| inhibit-splash-screen | t | ” |
| inhibit-compacting-font-caches | t | I have the RAM, I can take more memory usage. |
| mouse-yank-at-point | t | Make mouse paste at point. |
| widget-image-enable | nil | No more ugly buttons. |
| x-underline-at-descent-line | t | Underline line at descent position. |
| left-fringe-width | 1 | Make fringes more manageable. |
| right-fringe-width | 1 | ” |
| window-divider-default-right-width | 10 | Make dividers drag-able but small. |
| line-spacing | nil | Eliminate line spacing, I don’t like it. |
| use-dialog-box | nil | Kill the dialog boxes, I don’t like them. |
| find-file-visit-truename | t | Remove absurd file names. |
| mouse-wheel-scroll-amount | ‘(1 ((shift) . 1)) | Make scrolling consistent. |
| mouse-wheel-progressive-speed | t | ” |
| mouse-wheel-follow-mouse | t | ” |
| scroll-step | 1 | ” |
(ec-set-variables vars)This makes a nice scratch buffer with links to the documentation for saving it, has some code for elisp, and so on.
#+TITLE: Scratch Buffer
This is the scratch buffer, write whatever you want here. It won't be saved unless you enter the [[help:save-buffer][save-buffer]] command using \[save-buffer].
#+BEGIN_SRC emacs-lisp
;; You can also write code here.
#+END_SRC
And then we set the scratch buffer so it starts up with it.
(setq initial-scratch-message scratch-buffer)
(setq initial-major-mode 'org-mode)I like both having a visual bell and an auditory bell, so I have this function which makes a nice beep and blinks the modeline.
(defun ec-bell-function ()
(exec-shell-command "play -n synth 0.1 sin 500 chorus 1 0.9 55 0.4 0.1 2 -t")
(doom-themes-visual-bell-fn))Here some vars are defined.
| Variable | Value |
|---|---|
| doom-themes-enable-bold | t |
| doom-themes-enable-italic | t |
| doom-themes-org-fontify-special-tags | nil |
| ring-bell-function | #’ec-bell-function |
| custom-theme-directory | (f-expand “./”) |
(ec-set-variables vars)
Finally, we actually tangle and load the theme file.
(doom-modeline-mode +1)
(solaire-mode +1)
(let ((econf-out "econf-theme.el"))
(doom-themes-org-config)
; (org-babel-tangle-file "econf-theme.org" econf-out "emacs-lisp\\|elisp")
(load-theme 'econf t)
;; (delete-file econf-out)
)
; (org-babel-tangle-file "~/Memex/emacs-config/econf-theme.org" "~/Memex/emacs-config/econf-theme.el" "emacs-lisp\\|elisp")