1

Spacemacs by default comes with company for autocomplete. When typing, it shows all kinds of symbols matching what I have typed so far. This list can be very long.

Is there any way to search in the currently available completions?

Example: Say I want to add a key to an evil-mode keymap.

(define-key evil- will show a bunch of options but now I would like to filter those for the ones that also contain map.

2

Use C-s (company-search-candidates), use C-h f company-search-candidates to learn more:

company-search-candidates is an interactive compiled Lisp function in company.el.

(company-search-candidates)

Start searching the completion candidates incrementally.

Search can be controlled with the commands:

  • company-search-repeat-forward (C-s)

  • company-search-repeat-backward (C-r)

  • company-search-abort (C-g)
  • company-search-delete-char (DEL)

Regular characters are appended to the search string.

Customize company-search-regexp-function to change how the input is interpreted when searching.

The command company-search-toggle-filtering (C-o) uses the search string to filter the completion candidates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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