ergoemacs / ergoemacs-mode

ergoemacs-mode
ergoemacs.github.io/
GNU General Public License v3.0
293 stars 35 forks source link

key commands set in ido-setup-hook are not being respected #313

Closed nimms closed 10 years ago

nimms commented 10 years ago

I'm trying to set M-l and M-i to ido-next-match and ido-previous-match respectively so I can scroll through ido completions without moving my hands from the keyboard.

After reading through the ergoemacs documentation, I've tried both of the following and neither work

(add-hook 'ido-setup-hook
  (lambda ()
    (local-set-key (kbd "M-l") 'ido-next-match)
    (local-set-key (kbd "M-i") 'ido-prev-match)))

or

(add-hook 'ido-setup-hook
  (lambda ()
    (define-key ido-completion-map (kbd "M-i") 'ido-prev-match)
    (define-key ido-completion-map (kbd "M-l") 'ido-next-match)))
mattfidler commented 10 years ago

It should work, I'm unsure why it isn't working.

This will work, though

(ergoemacs-component my-ido ()
  "Fix ido to work with ergoemacs-mode"
  :require t ;; Install into ergoemacs themes.
  (when ido-setup-hook
    (define-key ido-completion-map (kbd "M-i") 'ido-prev-match)
    (define-key ido-completion-map (kbd "M-l") 'ido-next-match)))
mattfidler commented 10 years ago

Make sure to specify your layout, because the M- keys changed based on layout. That assumes you are using QWERTY. If you are using colemak, you would do:

(ergoemacs-component my-ido ()
  "Fix ido to work with ergoemacs-mode"
  :require t ;; Install into ergoemacs themes.
  :layout "colemak"
  (when ido-setup-hook
    (define-key ido-completion-map (kbd "M-i") 'ido-prev-match)
    (define-key ido-completion-map (kbd "M-l") 'ido-next-match)))
mattfidler commented 10 years ago

I also added the ability to turn this type of behavior on/off from the ergoemacs-mode menu since I believe many other people would want this. I used to like this behavior as well, but the current behavior is consistent with how ido defines previous/next character for C-f and C-b in regular emacs.

image

The other option is to use it directly from your emacs file:

(ergoemacs-require 'ido-prev-next-instead-of-left-right)
mattfidler commented 10 years ago

Or try ido-vertical-mode, which up and down are bound to next and previous matches.

nimms commented 10 years ago

Many thanks,

This fixed it.  

Kind regards Nimai Etheridge

On 19 September 2014 at 12:54:39 am, Matthew Fidler (notifications@github.com) wrote:

Or try ido-vertical-mode, which up and down are bound to next and previous matches.

— Reply to this email directly or view it on GitHub.