Emacs: Ido Mode Setup

By Xah Lee. Date: . Last updated: .

Make Ido Display Vertically

You can setup Ido Mode to display choices vertically, and turn on flex match.

emacs ido display vertically 2020-04-25 nwgfg
emacs ido display vertically 2020-04-25

Put this in your emacs init file:

(progn
  ;; make buffer switch command do suggestions, also for find-file command
  (require 'ido)
  (ido-mode 1)

  ;; show choices vertically
  (if (version< emacs-version "25")
      (progn
        (make-local-variable 'ido-separator)
        (setq ido-separator "\n"))
    (progn
      (make-local-variable 'ido-decorations)
      (setf (nth 2 ido-decorations) "\n")))

  ;; show any name that has the chars you typed
  (setq ido-enable-flex-matching t)

  ;; use current pane for newly opened file
  (setq ido-default-file-method 'selected-window)

  ;; use current pane for newly switched buffer
  (setq ido-default-buffer-method 'selected-window)

  ;; stop ido from suggesting when naming new file
  (define-key (cdr ido-minor-mode-map-entry) [remap write-file] nil))
;; big minibuffer height, for ido to show choices vertically
(setq max-mini-window-height 0.5)

Stop ido Suggestion When Writing File

When you call write-fileCtrl+x Ctrl+w】 (aka “save as”), when ido is on, it'll make suggestions. This is annoying because usually you don't want the name to be a existing file.

Here's how to stop ido suggestion when calling write-file.

Put this in your emacs init file:

(require 'ido)
;; stop ido suggestion when doing a save-as
(define-key (cdr ido-minor-mode-map-entry) [remap write-file] nil)

If you have a question, put $5 at patreon and message me.
Or Buy Xah Emacs Tutorial
Or buy a nice keyboard: Best Keyboards for Emacs

Emacs Tutorial

Emacs Init

Emacs Keys

ELisp

ELisp Examples

ELisp Write Major Mode


Emacs Init

Init Basics

packages

text editing

file

appearance

misc