Skip to content

ivy-minibuffer-map doesn't respect user bindings #466

@DamienCassou

Description

@DamienCassou

I use my own bindings for beginning-of-defun and end-of-defun:

(bind-key* "<S-left>" #'beginning-of-buffer)
(bind-key* "<S-right>" #'end-of-buffer)

But ivy-minibuffer-map keeps on binding ivy-beginning-of-buffer and ivy-end-of-buffer to their original keystrokes M-< and M->. Fortunately, there is an easy way to fix that:

(setq ivy-minibuffer-map
      (let ((map (make-sparse-keymap)))
      [...]
-    (define-key map (kbd "M-<") 'ivy-beginning-of-buffer)
-    (define-key map (kbd "M->") 'ivy-end-of-buffer)
+    (define-key map (vector 'remap 'beginning-of-buffer) 'ivy-beginning-of-buffer)
+    (define-key map (vector 'remap 'end-of-buffer) 'ivy-end-of-buffer)
     [...]

This means: "bind ivy-beginning-of-buffer to the same keystroke as beginning-of-buffer" and is described in elisp remapping command. With this in place, for me, ivy-beginning-of-buffer will be bound to S-<left> instead of M-<.

I can send a pull request if you want.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions