0

When using ergo emacs, for some reason M-l and M-j (forward-char and backward-char respectively) don't work properly in the minibuffer (with ido mode).

I've tried setting the ido-completion-map with the following:

(add-hook 'ido-setup-hook
  (lambda ()
    (define-key ido-completion-map (kbd "M-k") 'ido-next-match)
    (define-key ido-completion-map (kbd "M-i") 'ido-prev-match)
    (define-key ido-completion-map (kbd "M-l") 'ido-next-match)
    (define-key ido-completion-map (kbd "M-j") 'ido-prev-match)))

but these don't seem to stick.

I seem to be having a similar problem to this person: ido-mode binding masked by global-set-key but none of the solutions seems to work for me

Any help would be very appreciated

Kind regards Nimai

Community
  • 1
  • 1
nimms
  • 387
  • 4
  • 8

2 Answers2

0

Although the instructions at the outset of ido.el suggest using:

;; Customization
;; -------------
;;
;; Customize the Ido group to change the Ido functionality.
;;
;; To modify the keybindings, use the ido-setup-hook.  For example:
;;(add-hook 'ido-setup-hook 'ido-my-keys)
;;
;;(defun ido-my-keys ()
;;  "Add my keybindings for ido."
;;  (define-key ido-completion-map " " 'ido-next-match)
;;  )

I recently found that using the ido-common-completion-map had better luck when using a frame-switch function -- the original poster can substitute his / her own preferred keyboard shortcuts instead of m-tab and/or m-S-tab:

(add-hook 'ido-setup-hook 'ido-my-keys)

(defun ido-my-keys ()
  "Add my keybindings for ido."
  (define-key ido-common-completion-map (kbd "<M-tab>") 'ido-next-match)
  (define-key ido-common-completion-map (kbd "<M-S-tab>") 'ido-prev-match) )
lawlist
  • 13,099
  • 3
  • 49
  • 158
0

I have met the save problem, i'm using Emacs 24.4 with ergoemacs-mode-5.14.7.3 (i don't use the latest version of ergoemacs because it has the speed issue. See: github issue). After a lot of searching, i finally find this github commit, and get it work by adding below code to my emacs init file:

after enable ergoemacs-mode:

(when ido-mode
  (global-set-key [remap ido-magic-forward-char] 'ido-next-match)
  (global-set-key [remap ido-magic-backward-char] 'ido-prev-match))

Hope it helps, thanks!

muyifeng
  • 1
  • 1