Key bindings for move between input buffer and web page

I have not been able to find this anywhere in the key bindings documentation or in the manual.

I would like to know if there is a binding to toggling focus between the input buffer (for example after Ctrl+J) and the web page that is being viewed. I would like to be able to do this so that after getting the hints buffer I can scroll the web page that I'm looking at.

thanks

Hello and welcome! In fact there is such a binding :slight_smile: , you don't actually need to switch focus though, because there is a binding to "scroll other buffer". To see all the bindings while the prompt buffer is focused type in f1-b while it is running, and you should be able to see them!

Thank you. That does indeed sound much more like what I want. I'm completely new here (dev background and some LISP, but not lots), so I'll have some silly questions. I can see the commands that I want as yo describe, but it seems they do not have bindings. Can you point to docs to add bindings or an example?

No problem, I am happy to help :slight_smile:
please check out nyxt:manual#keybinding-configuration

it will hopefully help! Do not hesitate to reach out for more assistance. We are happy you are here!

I think going through configuration.lisp will help me. It will take a little while to get my lisp less rusty. I did try looking at nyxt:manual#keybinding-configuration but I think I need to get more context in my head to properly understand the information there. (When I tried the act on code it does not always appear to work, though now I can't get it to fail. Is this expected?)

If you execute list-messages you should see any failures in your configuration execution/loading. Sometimes (unfortunately) Nyxt silently ignores configuration errors.

Rather than going through configuration.lisp, which is very accurate, but also full of implementation details, I'd rather suggest looking at a configuration such as Artyom's (GitHub - aartaka/nyxt-config: My configuration files for Nyxt browser.) A lot of people look at it for some reason :smiley:

Thanks, I did take a look at that as well. I will have a go soon and probably come for help.

Oh, also, in the configuration.lisp definitions I found "M-o" 'toggle-prompt-buffer-focus in the default keyscheme, which will get me by until I manage to sort out how to make new binding.

@kortschak, the snippet below shows how the set of commands relevant to this thread can be easily remapped in your configuration file. If you find that the manual is confusing, please open an issue citing the exact passage. Thank you.

(define-configuration nyxt/mode/prompt-buffer:prompt-buffer-mode
  "Example."
  ((keyscheme-map
    (keymaps:define-keyscheme-map "my-prompt-buffer-mode" (list :import %slot-value%)
      nyxt/keyscheme:default
      (list
       "<my-keybinding>" 'toggle-prompt-buffer-focus
       "<my-keybinding>" 'scroll-other-buffer-down
       "<my-keybinding>" 'scroll-other-buffer-up
       "<my-keybinding>" 'scroll-page-down-other-buffer
       "<my-keybinding>" 'scroll-page-up-other-buffer
       "<my-keybinding>" 'toggle-prompt-buffer-focus)
      ;; nyxt/keyscheme:cua
      ;; (list)      
      ;; nyxt/keyscheme:emacs
      ;; (list)
      ;; nyxt/keyscheme:vi-normal
      ;; (list)
      ;; nyxt/keyscheme:vi-insert
      ;; (list)
      ))))

Note that if you rebind toggle-prompt-buffer-focus, then you need a similar declaration as above that will register it for base-mode.

Thank you @aadcg. I don't think there is anything in particularly difficult or confusing with the manual, it's just my newness to the system at this stage. Your snippet will certainly help and when I do work through the examples more carefully, if I find anything that I think is legitimately confusing, I will certainly file an issue.