Skip to main content
Share Your Experience: Take the 2024 Developer Survey
16 votes

How can I stop the enter key from triggering a completion in company mode?

My complete setup for fixing this annoying default behavior is: ;;; Prevent suggestions from being triggered automatically. In particular, ;;; this makes it so that: ;;; - TAB will always ...
Resigned June 2023's user avatar
14 votes

Speeding up company mode?

I had also a bad experience with company at the beginning, but in my setup I just put these lines. (setq company-dabbrev-downcase 0) (setq company-idle-delay 0) The first variable is used to skip ...
user3347359's user avatar
10 votes
Accepted

Company-mode completion for Org keywords

company-mode has company-capf. So the easiest way is adding pcomplete-completions-at-point to completion-at-point-functions: (defun my-org-mode-hook () (add-hook 'completion-at-point-functions '...
cutejumper's user avatar
9 votes

Change default company mode keybindings

I read about Change Minor Mode Keys in the fantastic Xah Lee pages. And I think I came with a solution. I found two different keymaps in company.el: company-active-map and company-search-map. So I ...
nephewtom's user avatar
  • 2,261
6 votes
Accepted

Display documentation in Company results

This issue occurs if emacs-racer and company-racer are both installed. They are distinct packages and are not compatible. Install only emacs-racer and the function signatures show up as expected.
Matthew Piziak's user avatar
6 votes

Activate company in not all modes

You can use company-global-modes to control that. (setq company-global-modes '(not lisp-mode)) (global-company-mode 1)
lurdan's user avatar
  • 1,071
6 votes
Accepted

Can I use emacs with company-mode and company-go to complete Go's standard library function names?

You need to tell company-mode what backend to use. In my init file I have the following code (add-hook 'go-mode-hook (lambda () (set (make-local-variable 'company-backends) '(company-go)...
Tephra's user avatar
  • 831
5 votes
Accepted

How do I install company-mode via `ensure-packages-installed`?

You need to use company instead of company-mode.
Saddle Point's user avatar
5 votes

How to create grouped company-backends list and an extra one for specific major mode?

I faced with this exact same problem a couple of weeks back. company-mode was not behaving as expected for some major modes and for major modes I got no completion at all. And it turns out the ...
Chakravarthy Raghunandan's user avatar
5 votes
Accepted

Add include paths to flycheck and to company-irony?

Irony-mode maintainer's here. Also using ROS at work. If you use catkin, then you can get along with irony-mode easily. I do not have ROS at my disposal right now but you should be able to do ...
Guillaume Papin's user avatar
4 votes
Accepted

Is there a company backend for completion in sql-interactive-mode?

I had a similar problem and decided to create my own backend. One of the existing backends (C++?) was used as a template and I modified it to create the new back end which behaves like a dictionary. ...
Jonakand's user avatar
4 votes
Accepted

Changing the completion speed in company

M-x customize-group Company Company-idle-delay (set this to a small value)
Jiadong's user avatar
  • 244
4 votes
Accepted

disable company-mode completion inside comments

Each backend decides whether it works in the given context. company-yasnippet works everywhere (you can counteract this using the keyword :with). company-files works where it sees a beginning of an ...
Dmitry's user avatar
  • 3,803
4 votes
Accepted

Show tooltip even if there is only one candidate in company-mode

company-preview-if-just-one-frontend is one of three frontends in company-frontends. To not use it, you'll need to remove it from that list and replace company-pseudo-tooltip-unless-just-one-frontend ...
wasamasa's user avatar
  • 22.2k
4 votes
Accepted

How to use an ispell dictionary in company mode?

You need provide a "plain word-list dictionary". Step 1, Check the code of company-ispell, it actually calls ispell-lookup-words. Step 2, check ispell-lookup-words documentation: "Optional second ...
chen bin's user avatar
  • 4,877
4 votes

Using company-ispell with large text dictionary?

It turns out the word list needs to be sorted (case insensitive), at least sorting it makes it work for me. Assuming you use company mode and have a shortcut to activate it. (use-package company :...
ideasman42's user avatar
  • 8,826
4 votes
Accepted

disable company-mode when editing C++ over tramp

Completely untested: (add-hook 'c++-mode-hook (lambda () (when (file-remote-p default-directory) (company-mode -1))))
Michael Albinus's user avatar
3 votes
Accepted

PHP completion with Company does not work on local variables

You only need php-extras-company and company-dabbrev, place them in the same group and at the BEGINNING of the company-backends, (add-hook 'php-mode-hook (lambda () (set (...
chen bin's user avatar
  • 4,877
3 votes

Company-mode completion for Org keywords

Inspired by a comment from @cutejumper, I went ahead and wrote a simple company backend that recognizes the ^#+ prefix to start using pcomplete. (defun org-keyword-backend (command &optional ...
purple_arrows's user avatar
3 votes

Is it possible to start company completion without a prefix?

As of recent versions of company, this is the way to go: (define-key company-mode-map [remap indent-for-tab-command] #'company-indent-or-complete-common)
Alexander Shukaev's user avatar
3 votes

Company mode popup closes after C-n

With use-package, this becomes: (use-package company :hook (after-init . global-company-mode) :bind (:map company-active-map ("C-n" . company-select-next-or-abort) ("C-p" . company-...
ppareit's user avatar
  • 141
3 votes
Accepted

Stop company-mode from completing dictionary words

You have to take a look at the variable company-backends. If you append the backends you want to use manually, the preconfigured backends will be ignored. So if you want to only complete python ...
bertfred's user avatar
  • 1,729
3 votes

No company mode found in packages list

The bit of configuration you provided does not actually evaluate, so I suspect your package list is not configured correctly. (Try it: copy your add-to-list code above in to a scratch buffer and then ...
glucas's user avatar
  • 20.6k
3 votes
Accepted

Emacs - elisp code autocompletion in emacs-lisp-mode

Add below line should work: (add-hook 'emacs-lisp-mode-hook 'ielm-auto-complete)
lucky1928's user avatar
  • 1,668
3 votes
Accepted

disable auto-completion for all buffers by default in spacemacs

You could add spacemacs/toggle-auto-completion-off to the buffer-list-update-hook by adding (add-hook 'buffer-list-update-hook 'spacemacs/toggle-auto-completion-off) to your .spacemacs-file (in the ...
Arnot's user avatar
  • 671
3 votes
Accepted

How to turn off autocompletion for numbers (and numbers only) in company-mode in spacemacs

It seems to be as simple as: (setq company-dabbrev-char-regexp "[A-z:-]") I got this far by studying this q&a: How can I prevent company-mode completing non-English chars?
jajpater's user avatar
  • 323
3 votes
Accepted

Why does company autocomplete 1000 to "and"?

This is an old bug. It has been resolved with this patch: https://github.com/jorgenschaefer/elpy/pull/1279
Markus Grunwald's user avatar
3 votes

Stop company-lsp from completing function arguments

There are actually two variables that drive this behavior. You tried the first one, lsp-enable-snippet and it didn't work. This means that the culprit is probably company-lsp, which engages in a ...
zaile's user avatar
  • 463
3 votes
Accepted

company-mode popups and magit current region are dark while current theme is light

The problem was this from my ~/.emacs file: '(frame-background-mode 'dark) '(hl-sexp-background-color "#1c1f26") I'm not really sure how it got there, but setting frame-background-mode to ...
Ricky Robinson's user avatar
3 votes
Accepted

What is the name of the face that appears in this list of company completions?

If you can't put your cursor on a character that has the face (which I'm guessing is the case for a Company popup menu), then use M-x list-faces-display. That shows you all of the currently defined ...
Drew's user avatar
  • 77.9k

Only top scored, non community-wiki answers of a minimum length are eligible