how to modify ido-mode keymaps reddit / emacs ---------------------------------------------------------------------- rzksobhy27 · 2022-04-30 12:45 I want to modify ido-mode keymaps i want to bind tab and shift-tab for navigation ​ this is my first day in Emacs btw but I'm already falling in love with it ---------------------------------------------------------------------- phundrak · 2022-04-30 13:15 `define-key` should get you covered. Its first argument is the keymap you want to assign a keybind to, the second one is the keybind itself, and the third is the function to assign to said keybind. For instance, to have `C-a` ignored in `ido-completion-map`, you would use `(define- key 'ido-completion-map (kbd "C-a") #'ignore)`. ---------------------------------------------------------------------- rzksobhy27 · 2022-04-30 13:29 I tried this but it's not working (define-key ido-completion-map (kbd "TAB") 'ido-next-match) (define-key ido-completion-map (kbd "backtab") 'ido-prev-match) ​ tab stills open a window of possible completions and shift tab says undifined ---------------------------------------------------------------------- phundrak · 2022-04-30 13:34 `backtab` is not a proper key name, what you want is `S-TAB`. ---------------------------------------------------------------------- rzksobhy27 · 2022-04-30 13:47 ok but they both are not working ---------------------------------------------------------------------- phundrak · 2022-04-30 13:48 Did you evaluate both expressions? ---------------------------------------------------------------------- rzksobhy27 · 2022-04-30 14:01 yes C-M-x right ? amd after I restart emacs it gives me an error ---------------------------------------------------------------------- 00-11 · 2022-04-30 15:48 `(define-key ido-completion-map (kbd "") 'ido-prev-match)` or `(define-key ido-completion-map [backtab] 'ido-prev-match)` You have to give `kbd` the same format of a key name that Emacs itself uses (in `*Help*`) to talk about the key. ---------------------------------------------------------------------- rzksobhy27 · 2022-04-30 17:14 all the docs said the same but I get this error for some reason Wrong type argument: keymapp, nil ---------------------------------------------------------------------- 00-11 · 2022-04-30 19:04 That's your answer - you didn't tell us about that error message. The value of `ido-completion-map` isn't a keymap. That's what the error msg is telling you. Did you create such a keymap and assign it to that var? Or did you load some library that does that? At least the variable is bound (to `nil`), so something has defined it, but not set its value to a keymap. Note that this error is entirely different from what you said the problem was before: > tab stills open a window of possible completions and shift tab says undifined ---------------------------------------------------------------------- rzksobhy27 · 2022-04-30 19:47 what I just typed in my config (ido-mode 1) about the problem I said before sorry I was evaluating the conffig with C-M-x this is my first day with emacs