[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Incrementally display the Emacs command list filtered out by the inp
Re: Incrementally display the Emacs command list filtered out by the input key words in real-time.
Fri, 2 Jul 2021 23:27:47 +0800
On Fri, Jul 2, 2021 at 8:51 PM Tassilo Horn <email@example.com> wrote:
> Hongyi Zhao <firstname.lastname@example.org> writes:
> > I tried the following code snippet posted at
> > <https://emacs.stackexchange.com/questions/13500/fuzzy-completion-style>,
> > but there is no effect at all:
> Emacs already has a fuzzy completion style (see the `flex' entry in
> `completion-styles-alist'), no need to copy&paste some 6 year old
> implementation from the internet.
> > (add-to-list 'completion-styles-alist
> > '(naive-fuzzy
> > completion-naive-fuzzy-try-completion
> > completion-naive-fuzzy-all-completions
> > "Simple naive-fuzzy completion, which never alters the
> > string to complete, unless a unique match exists."))
> > ;; (setq-local completion-styles '(naive-fuzzy))
> Try (setq completion-styles '(flex)). But note that the used
> `completion-styles' just defines how the input is matched against the
> things to be completed, i.e., you'll see no visual difference. See the
> manual at (info "(emacs) Completion Styles").
> To have a more visual UI, follow Eli's advice:
> >> And maybe try an alternative completion mode, like icompletion-mode.
> It is called `icomplete-mode'.
> Another very nice UI is the `vertico' package from GNU ELPA. Other
> popular choices include ivy, selectrum, etc.
Thank you very much for providing me with all kinds of information on
the packages which can achieve this aim. Based on my tries, it seems
that the ivy package, <https://github.com/abo-abo/swiper>, is one of
the most powerful one for this purpose. And the following simple
configuration can achieve the effect described here:
`(swiper :type git :host github :repo "abo-abo/swiper"
;("bash" "-c" "cd ~/.emacs.d/straight/repos/swiper")
(setq ivy-use-virtual-buffers t)
(setq ivy-count-format "(%d/%d) ")
Assoc. Prof. Hongyi Zhao <email@example.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China