Emacs: fido-mode (Minibuffer Name Completion)
What is fido-mode and fido-vertical-mode
fido-mode
is a feature that does name completion in Minibuffer- New in Emacs 27 (Released 2020-08)
- It emulates ido mode behavior.
- (fido is a nickname for “fake-ido”)
fido-vertical-mode
is like fido-mode, but show choices vertically.- New in Emacs 28 (Released 2022-04)
fido-mode
and
fido-vertical-mode
are part of icomplete-mode
.
They first turn on icomplete-mode
.
〔see Emacs: Icomplete, Minibuffer Name Completion〕
Using fido-mode and fido-vertical-mode
fido-mode
-
- Activates
icomplete-mode
, but use flex match. That is, you can type any char that are contained in the name. - No need to press Tab.
- Press Enter selects the first matched item and exit.
- Activates
fido-vertical-mode
-
Activates
fido-mode
, but show choices vertically.
Difference between fido-mode and icomplete-mode
There are two aspects of difference, submission and match method.
Submit Choice Difference
icomplete-mode
requires you to complete first, then submit your answer. Two distinct steps.fido-mode
always just select the closest match and submit it.
- The disadvantage of
icomplete-mode
way is that it's one more keystroke. - The disadvantage of
fido-mode
way is that if you are creating a new file (new name), it always submits a existing file name. You have to specifically press some key to tell it you don't want any existing choices. Or answer a prompt that ask you if you want to overwrite. (RISKY)
Matching Method Difference
icomplete-mode
does not use flex match by default. You have to type the starting letter of a name in order to complete.fido-mode
use flex match (it matches any substring or subset of chars in order.). Usually saves a lot keystrokes.
🛑 WARNING: Fido Mode, Copy or Rename File in Dired Overwrites
with fido mode on, when creating a file, or copying a file, etc in dired , be sure to press Ctrl+d to select current dir. Otherwise, if you press Enter, it selects current file choice and prompt to override file.
fido-vertical-mode keys
- Ctrl+d
-
do not use any suggestion, but use the current typed.
This is important, when you want to create a new file, dir, or dired for copy file, rename file. (corresponding command is badly named
icomplete-fido-delete-char
) - Enter
- Select current choice
- Alt+j
-
icomplete-fido-exit
“Attempt to exit minibuffer immediately with current input.” - Alt+t
-
icomplete-force-complete
“Complete the icomplete minibuffer.” - Ctrl+j
-
icomplete-force-complete-and-exit
“Complete the minibuffer with the longest possible match and exit. Use the first of the matches if there are any displayed, and use the default otherwise.”
- →
- next choice
- ←
- Prev choice
- ↓
- next choice
- ↑
- Prev choice
- Ctrl+s
- next choice
- Ctrl+r
- Prev choice
- Ctrl+.
- next choice
- Ctrl+,
- Prev choice
- Ctrl+n
- next choice
- Ctrl+p
- Prev choice
- Alt+<
-
icomplete-vertical-goto-first
- Alt+>
-
icomplete-vertical-goto-last