Emacs Init: Icomplete Mode
What is icomplete mode
Settings for Emacs Init
icomplete mode is complex with many sub modes and config options.
here's a quick brainless recommendation for your init file.
Put this in your Emacs Init File:
(when (>= emacs-major-version 28) (fido-vertical-mode))
or
(when (>= emacs-major-version 28) (progn (setq completion-styles '(flex)) (icomplete-vertical-mode)))
which one to use, see Emacs: fido-mode vs icomplete-mode
Completion Styles
you can setup many different completion styles.
here are different styles, from Completion Styles (Emacs Manual)
'basic-
- A matching completion alternative must have the same beginning as the text in the minibuffer before point.
- Furthermore, if there is any text in the minibuffer after point, the rest of the completion alternative must contain that text as a substring.
'partial-completion-
- This aggressive completion style divides the minibuffer text into words separated by hyphens or spaces, and completes each word separately.
- (e.g. when completing command names,
em-l-mcompletes toemacs-lisp-mode.) - Furthermore, a ‘*’ in the minibuffer text is treated as a “wildcard”—it matches any string of characters at the corresponding position in the completion alternative.
'emacs22-
- similar to
basic, except that it ignores the text in the minibuffer after point.
- similar to
'substring-
- A matching completion alternative must contain the text in the minibuffer before point, and the text in the minibuffer after point, as substrings (in that same order).
- Thus, if the text in the minibuffer is
foobar, with point betweenfooandbar, that matchesAfooBbarC, where A, B, and C can be any string including the empty string.
'flex-
if you typed
abcit is matched against*a*b*c*where * are any char or no char. 'initials-
lchmatcheslist-command-history
Setup completion-styles
- completion-styles
-
variable.
List of completion styles to use.
The available styles are listed in
completion-styles-alist
.
;; examples of setting completion styles ;; use flex match. (setq completion-styles '(flex)) ;; default in emacs 29 (setq completion-styles '(basic partial-completion emacs22))