However, none of the bindings seem to work when I open a web page with Nyxt (I have 2.2.4, SBCL 2.2.2, on FreeBSD).
Is :remap the right thing? Are some of my “simplifications” wrong?
Help would be appreciated.
You’re close, it’s just one thing: you don’t have to write (:remap ...) out – you can simply provide the keybinding and it will be rebound. Right now, it seems, '(:remap "C-s s") confuses the keymap library…
And insterting unquoted f3 can be a source of yet another error here. Unlike Emacs, we only allow strings as key designators – no chars, numbers, or symbols
Nevertheless, it still seems that things aren’t working. E.g. if I visit a web page, f3 is still active, and “C-s” simply writes Pressed keys: "C-s" in the minibuffer.
(define-configuration nyxt/web-mode:web-mode
(
(nyxt/web-mode::keymap-scheme
(define-scheme (:name-prefix "web" :import %slot-default%)
scheme:emacs
(list
"C-c p" 'copy-password ; appears to work
"C-c y" 'autofill ; can't check right now
"f3" 'nothing ; works
"C-s k" 'nothing ; works
"C-s s" 'nothing ; works
"C-s h" 'nothing ; works
"M-s h" 'history-all-query ; does not work
"C-s" 'search-buffer ; does not work
)))
)
)
I see. I’ve just experimented with your snippet, and using "C-s" 'nyxt/web-mode:search-buffer instead of "C-s" 'search-buffer seems to fix it – keymap is extremely sensitive about what you provide it with. In this case, the problem was that there’s no nyxt:search-buffer, there’s only nyxt/web-mode:search-buffer.
Hmm, I don’t understand this. We are configuring web-mode aren’t we? And nyxt/web-mode:search-buffer to me says that search-buffer “belongs” to web-mode.
Anyhow, I conclude that configuring key bindings is highly non-trivial! Perhaps that could be improved in the future?