2

I was using regular find-file, and have a current setup to delete a word, which was working inside find-file.

(defun backward-delete-word (arg)
  "Delete characters backward until encountering the beginning of a word.
With argument ARG, do this that many times."
  (interactive "p")
  (delete-region (point) (progn (backward-word arg) (point))))

(global-set-key "\C-o" 'backward-delete-word)

When I switch to ido via (ido-mode 1) word deletion does not work in ido-find-file minibuffer.

[Q] Is there any way to do backward word deletion in ido-find-file?

8
  • try using M-backspace or M-DEL to delete words backward. It's bound to backward-kill-word
    – Muihlinn
    Commented May 2, 2020 at 12:27
  • Is there any way to do it with different key-binding such as \C-o?
    – alper
    Commented May 2, 2020 at 12:43
  • sure, just add one with define-key or global-set-key depending your goals. Be careful with global bindings.
    – Muihlinn
    Commented May 2, 2020 at 12:44
  • I set \C-o for it as ((global-set-key "\C-o" 'backward-kill-word) ); but ido sees it as TAB
    – alper
    Commented May 2, 2020 at 12:54
  • (global-set-key (kbd "C-o") 'backward-kill-word)
    – Muihlinn
    Commented May 2, 2020 at 13:03

1 Answer 1

2

It was conflicting with ido's keybinding so I disabled it.

(defun bind-ido-keys ()
  "Keybindings for ido mode."
  (define-key ido-completion-map (kbd "\C-o") 'nil))

(add-hook 'ido-setup-hook #'bind-ido-keys)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.