Bits and pieces of code in this config come from all over the net, including “better-defaults” “spacemacs” “prelude” “purcell” “emacs wiki” and more. Thanks to all of those heavy-hitters and everybody from #emacs on Freenode.
My configuration is simpler, and probably more opinionated than those before mentioned, but I do still borrow heavily from prelude and others– because maintaining a sophisticated Emacs configuration single-handedly is just too much work!
This README.org file is also a template that gets copied as ~/$USER.org automatically– to be used as a 100% customizable and persistent org-mode Emacs Start page :-)
There are accompanying dotfiles.
EXWM TIPS & TRICKS
On EXWM and “Default Applications”
I use “mimi,” an xdg-open drop-in replacement in addition to a .mailcap file to inform Emacs / EXWM about default applications for various filetypes. https://github.com/a-schaefers/dotfiles/blob/gentoo/bin/xdg-open (mimi script) https://github.com/a-schaefers/dotfiles/blob/gentoo/.config/mimi/mime.conf (mimi config)
The mailcap file is necessary for gnus when opening file attachments. https://github.com/a-schaefers/dotfiles/blob/gentoo/.mailcap
Edge cases in Emacs/EXWM such as default browser are covered in my cfg-general.el file, https://github.com/a-schaefers/dot-emacs/blob/master/lisp/cfg-general.el In my case, I prefer to set the browser to be “chrome”, which is actually a script in ~/bin https://github.com/a-schaefers/dotfiles/blob/gentoo/bin/chrome like so,
#!/bin/bash firejail google-chrome-unstable --incognito "$@"
Similarly, to have browser Email URL’s to open using gnus, the browser mailto handler should be set to run a script as follows:
#!/bin/bash emacsclient -e "(gnus)" -e "(browse-url-mail \"$@\")"
On EXWM and launching external programs
I use M-x helm-run-external-command with the following snippet which uses wmctrl to pop previously opened windows to the front of the stack:
(when (executable-find "wmctrl") (setq helm-raise-command "wmctrl -xa %s"))
So be sure wmctrl is installed!
Why left alt and left ctrl should be swapped for Emacs ergonomics?
The following is the perfect Emacs keyboard layout:
<stupidkey> <SUPER> <CTRL> [SPACE] <ALT> <SUPER> <stupidkey><stupidkey>
Imagine the above layout is enabled, now press <CTRL> with your left thumb. Likewise, press <ALT> with your right thumb, now press any key without strain. Goodbye “emacs pinky!”
setxkbmap -option ctrl:swap_lalt_lctl
The keybinds in this file stay close to defaults, but add a Super key shortcut. For example, shortcut for C-c <left> (winner under) is simple <s-left> … That’s my rule of thumb. :)
I also remap caps lock to be <menu> via
setxkbmap -option caps:menu
This is because Caps is the perfect hydra location and I put nested hydras on caps. Credit for all of the above: ldlework from #emacs on freenode. Ergonomics+Emacs! THANKS!
To see how to use nested hydras on <CAPS> , check out https://github.com/a-schaefers/dot-emacs/blob/master/lisp/cfg-exwm-and-keybinds.el