69 votes
Accepted

How to make Company mode be case-sensitive on plain Text?

After some research, I came across the company mode git hub ticket, which says that company mode uses dabbrev for plain text as backend. dabbrev has an option to downcase things, it is turned on ...
41 votes

What are the differences between autocomplete and company mode?

They're pretty much equivalent, but company-mode has a better thought-out API for plugin developers. It's also much more actively maintained. But there are two key differences which may or may not ...
user avatar
  • 2,781
40 votes
Accepted

Get Company to show suggestions for Yasnippet names

I have the following snippet in my configuration and it seems like it's exactly what you want: ;; Add yasnippet support for all company backends ;; https://github.com/syl20bnr/spacemacs/pull/179 (...
user avatar
  • 516
37 votes
Accepted

What are the differences between autocomplete and company mode?

I've used autocomplete-mode for a good a few years and switched to company-mode a couple of months ago. In basic usage there's not much of a difference. Like someone else posted this link has a good ...
user avatar
  • 603
32 votes
Accepted

How add company-dabbrev to the Company completion popup?

Here is how completion in company works (I am simplifying a bit; a more detailed description can be found in documentation of company-backends C-hvcompany-backendsRET. You have a list of backends (...
user avatar
  • 7,308
25 votes

Find out backend used in company completion

You can type M-x company-diag now, and see the used backend in the resulting buffer.
user avatar
  • 3,278
25 votes
Accepted

How to make yasnippet and company work nicer?

This is what I created for myself, facing the same issue. It is from company-mode's Emacs Wiki page, but heavily extended: (defun check-expansion () (save-excursion (if (looking-at "\\_>") t ...
user avatar
19 votes
Accepted

How can I get fuzzy code completion

Emacs's builtin completion functionality offers similar fuzzy matching (tho by default it's used for "do-so-am" rather than for "DoSoAm") and IIUC recent versions of company-mode do use this at least ...
user avatar
  • 25.4k
16 votes
Accepted

I want company-mode to show completions list after the second character

You can set company-minimum-prefix-length to a desire value of your choice: (setq company-minimum-prefix-length 2) You can use the customize interface M-x customize and search for company in there ...
user avatar
  • 6,682
15 votes

filename completion using company-mode

As @Jesse already pointed out, what you want here is the company-files backend. There are several different ways to use it: Bind a key to call company-files directly. Use command company-begin-...
user avatar
  • 19.4k
15 votes

Best company-backends lists

You can set a default company-backends, then use hook to append different backends to different mode. Here is a way I config in my emacs. ;; set default `company-backends' (setq company-backends ...
user avatar
  • 1,778
14 votes
Accepted

How to automatically run inferior process when loading major mode for the first time?

FYI, some modes open only one inferior processs. For example, run-python will open an inferior process only if there isn't already an inferior process running. What you suggested with run-python ...
user avatar
  • 1,683
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 ...
user avatar
  • 327
13 votes

How to make yasnippet and company work nicer?

Here's the code that I'm using: (global-set-key "\C-o" 'aya-open-line) (defun aya-open-line () "Call `open-line', unless there are abbrevs or snippets at point. In that case expand them. If there'...
user avatar
  • 13.6k
13 votes
Accepted

Symbol's value as variable is void: company-backends

You've configured company-mode to load after your init file is evaluated using the after-init-hook, but are then trying to modify company-backends right away. That variable isn't defined until ...
user avatar
  • 19.4k
13 votes
Accepted

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

This is defined in company-active-map. You can unbind the return key in that map: (define-key company-active-map (kbd "<return>") nil) Note however that return and tab do different things when ...
user avatar
  • 19.4k
13 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 ...
user avatar
11 votes
Accepted

Company mode popup closes after C-n

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-...
user avatar
  • 4,004
10 votes
Accepted

Jump to documentation buffer with company-mode

I don't see a way built in to company-mode to do this, but you can add your own key binding to company-active-map. As a quick experiment I took the company-show-doc-buffer implementation and simply ...
user avatar
  • 19.4k
10 votes
Accepted

How can I prevent company-mode completing numbers?

This can be solved by modifying company-transformers with the following code: (push (apply-partially #'cl-remove-if (lambda (c) (or (string-match-p "[^\...
user avatar
  • 2,350
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 '...
user avatar
9 votes
Accepted

Find out backend used in company completion

company has a very useful feature that modifies its modeline lighter to display the backend currently in use.
user avatar
  • 21.1k
9 votes
Accepted

How do I use company-mode in some buffers and auto-complete-mode in others?

Try this: (add-hook 'js-mode-hook 'my-javascript-hook) (defun my-javascript-hook () (company-mode -1) (auto-complete-mode 1))
user avatar
  • 13.6k
9 votes

How can I get fuzzy code completion

With company-mode, you can use C-s to search from available candidates that it display. The search query is displayed in the modeline (not really easy to spot, I know. I filed an issue here). If you ...
user avatar
  • 6,682
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 ...
user avatar
  • 2,099
8 votes
Accepted

filename completion using company-mode

You have to run company-files for file completion. You can bind a different map for the files completion completion with (define-key global-map (kbd "C-.") 'company-files) Also make sure you have ...
user avatar
  • 1,914
8 votes
Accepted

What is the hook used by company-mode to perform autocompletion?

Unless you invoke one of the completion commands directly (such as M-x company-complete-common), the completion maybe-happens and the popup is rendered in company-post-command. It looks at the ...
user avatar
  • 3,278
8 votes
Accepted

How do I get company mode to recognize clang?

OP here, my clang executable wasn't being recognized by company-clang because the name of the executable in my /usr/bin was clang-3.5 and not clang. Using M-x customize-variable RET company-clang-...
user avatar
  • 111

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