This module enables and provides sane defaults for the Emacs X Window Manager (EXWM).
- Control applications as Emacs buffers.
- Edit any application’s input field with Emacs.
- Use Emacs input methods in other applications.
- Use VIM keys in major web browsers like Firefox and Chrome.
- Launch and control nested Emacs sessions within Emacs.
- @LemonBreezes (Author)
This module provides no flags.
When switching to a workspace where an EXWM buffer is focused, inputs do not get passed to the application. To work around this, I wrote a hook which briefly activates the minibuffer for input and then quits the minibuffer.
This module has no prerequisites.
- Edit any application’s input field with
C-c '
. - Use Emacs input methods in other applications. Simply set the input method as
usual with
C-x RET C-\
. - Open nested sessions of Emacs with alternate configurations.
- Use Evil in any application! Specific browsers such as Google Chrome and
Firefox have extended support for Evil keybindings. Simply install the
link-hints
extension/add-on and start VIM-ing!
Moreover, when this module is loaded, the following global keybindings are made:
Keybinding | Description |
---|---|
SPC $ | Open a GNU/Linux application |
SPC o n | Open a nested Emacs session |
SPC o N | Open a nested vanilla Emacs session |
SPC f v | Find file in vanilla Emacs |
SPC f V | Find this file in vanilla Emacs |
C-c ' | Edit input field in Emacs |
In order to enable EXWM, Emacs needs to be running within X.Org without any
window manager present. The recommended way to go about this is with the
startx
script. The EXWM wiki contains an example xinitrc
file for use by
startx
.
By default, when you edit an application’s input field and no programming
language can be detected in the text, org-mode
will your major mode. If you
would like to change this, set the +exwm-edit-default-major-mode
variable:
(setq +exwm-edit-default-major-mode 'markdown-mode)
For users of Evil, the f
and F
keys are bound to special Link Hint commands
within Chrome-based and Firefox-based web browsers. For these commands to work,
you must have the Link Hint add-on/extension installed. For Chrome-based web
browsers, install Link Hint through here. For Firefox-based web browsers, use
this link instead.
Currently this module does not provide any simplified setup for multi-head configurations. Please refer to https://github.com/ch11ng/exwm/wiki#randr-multi-screen for how to do this.
Although we provide a curated default vanilla-Emacs configuration (without Evil), you can write your own configuration file and evaluate
(setq +exwm-vanilla-emacs-config-file "/path/to/alternate-emacs-config.el")
If you would like i3-style keybindings, I recommend adding the following paragraph to your private configuration:
;; i3-like keybindings for EXWM
(windmove-mode +1)
(when (featurep! :private exwm)
(map! "s-j" #'windmove-left
"s-k" #'windmove-down
"s-l" #'windmove-up
"s-;" #'windmove-right
"s-J" #'windmove-swap-states-left
"s-K" #'windmove-swap-states-down
"s-L" #'windmove-swap-states-up
"s-Q" #'delete-window
"s-:" #'windmove-swap-states-right
"s-v" #'split-window-right
"s-h" #'split-window-below
(:when (featurep! :ui workspaces)
"s-1" #'+workspace/switch-to-0
"s-2" #'+workspace/switch-to-1
"s-3" #'+workspace/switch-to-2
"s-4" #'+workspace/switch-to-3
"s-5" #'+workspace/switch-to-4
"s-6" #'+workspace/switch-to-5
"s-7" #'+workspace/switch-to-6
"s-8" #'+workspace/switch-to-7
"s-9" #'+workspace/switch-to-8
"s-0" #'+workspace/switch-to-final
(:when (featurep! :term vterm)
"s-<return>" (defun +run-or-raise-vterm ()
(interactive)
(+workspace-switch "Vterm" t)
(let ((display-buffer-alist))
(vterm most-positive-fixnum)))))
"s-d" #'app-launcher-run-app
"s-'" #'exwm-edit--compose)
(after! exwm
(dolist (key '(?\s-h ?\s-j ?\s-k ?\s-l ?\s-H ?\s-J ?\s-K ?\s-L ?\s-0 ?\s-1
?\s-2 ?\s-3 ?\s-4 ?\s-5 ?\s-6 ?\s-7 ?\s-8 ?\s-9 ?\s-d
?\s-\; ?\s-v ?\s-' ?\C-\[ ?\s-Q))
(cl-pushnew key exwm-input-prefix-keys))))
Keybind | Description |
---|---|
C-c C-i | Send the escape key (only bound when Evil is enabled). |
C-c C-c | Send the C-c key. |
C-c C-q | Send the next key to the application. |
I (the author) do not know how to suppress or remove the, “evil-mouse-drag-region must be bound to an event with parameters” error. I recommend ignoring this error though as your clicks still register.
This bug is a result of a workaround I copied from this GitHub issue: walseb/exwm-firefox-evil#1
- [ ] Document workarounds for packages utilizing child frames.
- [ ] Write a separate nested Emacs mode.
- [ ] Add Evil to the nested vanilla Emacs configuration file.