4

Company-mode gives me a popup with options, but once I press C-n to navigate through the options, the popup disappears (I can still cycle through the options , but they are shown inline). I want the popup to remain open until I make my selection. Is this a customizable behavior (for instance, this screencast shows a company-mode popup which remains open while he cycles through values)?

Could some other mode be interfering and closing the popup (e.g., evil-mode)? How would I go about debugging that (I'm new to emacs)? Thanks!

  • Unless you have changed settings, I believe company uses M-n (Alt-n) to cycle through options. – user2699 Nov 10 '15 at 0:23
7

company-mode does not rebind C-n or C-p probably to minimize interference with normal editing commands. To cycle through options, Company uses up, down, M-n, and M-p by default.

Use C-h f company-mode to peruse the mode specific documentation for Company. It will show the available bindings for the company popup when it is active.

However if you do want C-n and C-p in addition to the existing bindings the following elisp should help.

(define-key company-active-map (kbd "C-n") 'company-select-next-or-abort)
(define-key company-active-map (kbd "C-p") 'company-select-previous-or-abort)

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.