Open spiderbit opened 3 years ago
If I change the xah-fly-command-mode-init to set the transient-map I want depending on mode, it works when I go first in insert mode and back to command mode afterwards, but always keeps that keymap when I switch windows, and not updates it back to the other command mode:
(defun xah-fly-command-mode-init ()
"Set command mode keys.
Version 2020-04-28"
(interactive)
(setq xah-fly-insert-state-q nil)
(xah-fly--update-key-map)
(let ((map
(if (eq major-mode 'exwm-mode)
xah-fly-exwm-command-map
xah-fly-command-map)))
(setq xah-fly--deactivate-command-mode-func
(set-transient-map map (lambda () t))))
(modify-all-frames-parameters (list (cons 'cursor-type 'box)))
(setq mode-line-front-space "C")
(force-mode-line-update))
Do I have to make the keymaps local or something to not get overwritten by other buffers?
Adding that advises seem to fix it but it's a ugly hack:
(advice-add 'other-window :after (lambda (x)
(xah-fly-insert-mode-activate)
(xah-fly-command-mode-activate)))
(advice-add 'other-frame :after (lambda (x)
(xah-fly-insert-mode-activate)
(xah-fly-command-mode-activate)))
(advice-add 'switch-to-buffer :after (lambda (x)
(xah-fly-insert-mode-activate)
(xah-fly-command-mode-activate)))
Basically what I want is to have in exwm buffers to have only a few commands in command mode and handle the rest like in insert-mode so that the X buffers can use this keys.
As example in a exwm buffer i/k or in dvorak c/t for forward-line / backward-line doesn't make sense.
shouldn't that setup the exwm-command-map instead of the normal command-map in exwm buffers? the comparsion works, but despite I have not defined forward-line in exwm-command-map it's still defined.
Tried to overwrite it with "nil": ("t" . nil)
But it is still bound to forward line, till now I used that as hook: (setq xah-fly-command-map (assq-delete-all ?t xah-fly-command-map))
That kind of worked... do I have to change something else to add such hybrid-keymap / alternative command-map into fly-keys?