Prompt buffer keybindings


First of all, thanks for the awesome product.

I’m experiencing problems with setting C-y as paste keybinding to paste something into new buffer url prompt. By diving into Nyxt code a bit deeper, I’ve find the default S-Insert which works well, but it seems to be GTK platform port binding, which is another layer of abstraction. Meanwhile, other people configurations either won’t work by now (maybe because of some semi-incompatible changes between Nyxt versions, I use 2.0.0 on NixOS) or does not give any clue on what to do further.

Could you please point me into the right direction?

Are you able to bind anything in your prompt buffer? Can you please provide a paste of what you’ve tried?

Unfortunately, I’ve dropped all previous attempts code from config at the moment, but here is a pretty literal example of what I’ve tried: nixos-config/nyxt.lisp at db9a568c3e64e8945813953fa89783203e81fb98 · tmplt/nixos-config · GitHub

PS I’ve stumbled upon upon this concrete keybinding and did not go further, so there are no more things I’ve tried to bind.

I see, what is going on. In the prompt buffer you want to actually bind nyxt/prompt-buffer-mode::select-first and nyxt/prompt-buffer-mode::select-last.

That’s a little different than just scrolling the page. I hope that helps!

Seems like I’ve suddenly misguided you. I’ve retried my attempts, and here is what actually going on.

(defvar *custom-prompt-keymap* (make-keymap "custom-prompt-map"))
(define-key *custom-prompt-keymap*
  "C-y" 'minibuffer-paste)
(define-mode custom-prompt-mode ()
  ((keymap-scheme (keymap:make-scheme
                   scheme:cua *custom-prompt-keymap*
                   scheme:emacs *custom-prompt-keymap*
                   scheme:vi-normal *custom-prompt-keymap*))))

(define-configuration prompt-buffer
    ((default-modes (append '(custom-prompt-mode emacs-mode) %slot-default%))
     ;; (default-modes `(emacs-mode ,@%slot-default%))
     (hide-single-source-header-p t)))

This is the code I added.
But here is an error pops up: “Could not load the init file: unknown type specifier: LAMBDA”

The command you are looking for is 'paste, we do not refer to it as a minibuffer anymore.

Here is a full configuration to do what you want:

(define-mode custom-prompt-mode ()
  "Mode for binding my own prompt commands."
    (define-scheme "custom-prompt-mode"
       "C-y" 'nyxt/prompt-buffer-mode::paste)
       "C-y" 'nyxt/prompt-buffer-mode::paste)
       "C-y" 'nyxt/prompt-buffer-mode::paste)))))

(define-configuration prompt-buffer
    ((default-modes (append '(custom-prompt-mode emacs-mode) %slot-default%))
     (hide-single-source-header-p t)))

Anyways, thank you for the report, it made me realize a binding was missing! I’ve since fixed it here:

1 Like

Many thanks! I’m already thinking of dig Nyxt core a bit deeper and then contribute, as I did with Stumpwm a couple of years ago. =)

That would be fantastic! We would be glad to have you onboard :slight_smile: