As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [company-mode]

Company-mode is a text completion framework for Emacs. The name stands for "complete anything". It uses pluggable back-ends and front-ends to retrieve and display completion candidates.

Filter by
Sorted by
Tagged with
59 votes
2 answers
19k views

What are the differences between autocomplete and company mode?

There seem to be two major autocompletion extensions for emacs: autocomplete and company mode. What are some of the practical differences between the two and when would I want to use one over the ...
Connor's user avatar
  • 1,581
49 votes
1 answer
5k views

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

By default, Company mode seems to convert every prediction into lower case. E.g: HelloWorldOfGoo HelloWorldOfEmacs -> Hell [Helloworldofgoo] //Company prediction [...
Leo Ufimtsev's user avatar
  • 4,478
28 votes
5 answers
8k views

How can I get fuzzy code completion

When using ReSharper in Visual Studio symbols can be auto-completed using fuzzy matching instead of prefix matching. For example if I'm looking for a function named DoSomethingAmazing I could write ...
Jake Woods's user avatar
27 votes
2 answers
10k views

How to make yasnippet and company work nicer?

In my emacs, let's say, I use a "elisp" yasnippet to extend a lisp block in org-mode. But before I extend it, company is triggered first, which gives me a menu like "1. elisp1, 2. elisp2" without an ...
Leu_Grady's user avatar
  • 2,420
25 votes
3 answers
8k views

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

I often want to go to a newline while the company mode suggestion is showing. How can I set up company mode so only the tab key triggers a completion?
Connor's user avatar
  • 1,581
19 votes
1 answer
9k views

Get Company to show suggestions for Yasnippet names

I use the packages Company mode and Yasnippet. When I'm typing in a buffer, I get autocompletion suggestions from Company. For Yasnippet, I have a directory which contains the snippets. In that ...
ReneFroger's user avatar
  • 3,855
16 votes
1 answer
6k views

How add company-dabbrev to the Company completion popup?

Setup: GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL Compiled from EmacsW64. , using the latest version of from MELPA Windows 7 x64 bit. Situation: For example, I'm ...
ReneFroger's user avatar
  • 3,855
15 votes
1 answer
2k views

How can I use Company to spell-check a word?

company-ispell can complete a word at point, but what if you want to use Company to list the possible corrections for spelling? As an added bonus, is there any way to integrate this into Flyspell?
Sean Allred's user avatar
  • 6,801
14 votes
3 answers
3k views

Find out backend used in company completion

When using custom company backends, company-complete ends up returning no completions due to a misbehaving backend. In such cases, it would be helpful to know out which company backend was used to ...
Pradhan's user avatar
  • 2,310
13 votes
3 answers
6k views

filename completion using company-mode

I enabled company using the following commands in my init.el: (require 'company) (add-hook 'after-init-hook 'global-company-mode) However I'm not getting filename completion, although there is some ...
Emmanuel Touzery's user avatar
12 votes
1 answer
4k views

How to remap Company's select next and select previous keys?

I don't like the default M-n and M-p keys for company-select-next and company-select-previous so I was wondering if it's possible to remap those to C-n and C-p without affecting the mappings when ...
caisah's user avatar
  • 4,026
12 votes
1 answer
10k views

Speeding up company mode?

I switched from sublime text to emacs a while back, and while I feel emacs is much nicer, its autocompletion is really lacking in responsiveness. I went and customized company so that it would try to ...
m0meni's user avatar
  • 743
12 votes
3 answers
4k views

How can I get C/C++ context-sensitive completion with Company?

Semantic seems to be able to do this, but I cannot get it to work as I would expect it to. For example, if I #include "Type.h" and declare Type t, using semantic-complete-analyze-inline when point is ...
Sean Allred's user avatar
  • 6,801
11 votes
1 answer
9k views

Best company-backends lists

I know this isn't the best type of question for stack... but I can't think of another place where it might get enough exposure. So I really like company-mode, but sometimes it's annoying to have to ...
aiguofer's user avatar
  • 588
11 votes
3 answers
2k views

How can I prevent company-mode completing numbers?

In org-mode, when I type some numbers, company always pops up the number completion like: 20 20001 -----------1200111 ----------2 These numbers come from my org-mode files. I would like to ...
Leu_Grady's user avatar
  • 2,420
11 votes
2 answers
2k views

Jump to documentation buffer with company-mode

I have recently switched from auto-complete-mode to company-mode and I having fun. Recently I had to write some Emacs Lisp code. I start typing my function, completion candidates are shown, I press F1 ...
petrux's user avatar
  • 665
11 votes
0 answers
2k views

Use helm-company as default for company autocompletion?

I want helm-company as the default selection method for company. Helm-company is meant to be invoked manually after company completion started. But I would really like to invoke helm automatically on ...
clemera's user avatar
  • 3,391
10 votes
1 answer
3k views

variable project root folder in .dir-locals.el

I'm using company-mode for completion in C++ code. To tell clang backend of company where the include files for the current project are I have to use the following .dir-locals.el file ((c++-mode (...
kain88's user avatar
  • 815
10 votes
1 answer
2k views

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

I'm using sql-interactive-mode, and I'm in need for a Company backends that will complete SQL keywords, and preferably, also column/table names of the used database. When looking around for any ...
ReneFroger's user avatar
  • 3,855
9 votes
1 answer
4k views

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

Let's say we are working with Python (or Matlab) with company. Without an inferior process company messages that Completion needs an inferior Python process running However, the obvious solution to ...
Pushpendre's user avatar
8 votes
3 answers
4k views

Company-mode completion for Org keywords

Org mode has completion for all keywords via pcomplete, as noted by Andrew Swann. However, Company does not seem to pick up on these keywords. Calling company-complete on the following, where | ...
Tianxiang Xiong's user avatar
8 votes
2 answers
1k views

Adaptive sorting of a company backends results

Is there a way of asking company to sort the results it shows based on past choices? The custom variable company-transformers controls this behaviour. The only built-in choices are company-sort-by-...
Pradhan's user avatar
  • 2,310
8 votes
2 answers
3k views

Is it possible to start company completion without a prefix?

Autocompletion is particularly useful in writing CSS, to see the available options for a given property. Company provides company-minimum-prefix-length to control how many characters I have to type ...
Wilfred Hughes's user avatar
8 votes
4 answers
846 views

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

When typing a number in spacemacs all kind of numbers are being suggested. I can autocomplete them with enter. I like this behaviour in the case I'm typing words (made up of letters). But I don't want ...
jajpater's user avatar
  • 323
7 votes
1 answer
4k views

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

When typing in a buffer with company-mode the completions popup shows after typing the third character: Is it possible to do this after typing the first or second charater?
max0r's user avatar
  • 280
7 votes
1 answer
2k views

How to exclude a company-backend from autocompleting without globally removing it

I would like to be able to prevent company mode from automatically suggesting a specific backend (namely company-dabbrev) when in a specific mode (using text-mode-hook), however I don't want want to ...
nedned's user avatar
  • 211
7 votes
2 answers
578 views

How to make private python methods the last company-mode choices?

I'm using emacs with company-mode and I'd like the 'private' methods (method that start with underline) to be shown last, since they are kind of useless for imported libraries in python. See the image:...
Jesse's user avatar
  • 1,974
7 votes
1 answer
2k views

Autocompletion using company in org src buffer?

I can't seem to get completion when editing an org-babel source code block. Elpy and company-mode both appear to be enabled minor modes for the buffer, but no completion candidates appear as they do ...
Pliny Suetonious's user avatar
6 votes
2 answers
2k views

Company mode popup closes after C-n

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 ...
MkMz's user avatar
  • 63
6 votes
1 answer
1k views

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

My init.el loads company with (global-company-mode). I want to make an exception for Javascript buffers, and instead use auto-complete-mode for that mode. Q: I am struggling to find a way to unhook ...
Chris's user avatar
  • 699
6 votes
1 answer
495 views

Display documentation in Company results

The GitHub page for emacs-racer shows function signatures in company completion results. My results display "Function" and nothing beyond. I've searched through customize-group company and can't ...
Matthew Piziak's user avatar
6 votes
1 answer
3k views

How should I configure irony-mode if my project has no "compilation flags"?

irony-mode is: an Emacs minor-mode that aims at improving the editing experience for the C, C++ and Objective-C languages. It works by using a combination of an Emacs package and a C++ program (irony-...
shackra's user avatar
  • 2,692
6 votes
2 answers
689 views

Insert parens while completing functions in company mode

If i select first option it will become l.remove But as the completion candidate is function type, how can i make it to l.remove() so that i don't have to manually type parens?
Chillar Anand's user avatar
6 votes
1 answer
513 views

Ragged menu in company-mode

I am using emacs-mac-port 24.4 on OSX 10.10. My company-mode drop-down menu is ugly. The unicode symbols in it are not the same width, which results in a ragged menu. The left image is with Monaco, ...
neic's user avatar
  • 161
6 votes
0 answers
267 views

Proportional font breaks company overlays

When I use a proportional font with buffer-face-mode, it breaks company's overlay, because company obviously counts offset from the left margin, as well as pads suggestions on the right in character ...
Alaks's user avatar
  • 61
5 votes
1 answer
5k views

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

I'm trying to setup robe for Rails development. It needs company mode and I have some issues with it: Have following in init.el: ;; robe, documentation lookup and completion for Ruby (require 'robe) (...
foki's user avatar
  • 876
5 votes
1 answer
3k views

Change default company mode keybindings

I think company-mode is a great package. Though I would like to change some keybinding it has assigned by default. For example, I would prefer not to use M-n and M-p in order to move in the different ...
nephewtom's user avatar
  • 2,199
5 votes
1 answer
2k views

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

According to describe-key (C-h k), every character I type runs self-insert-command and I suspect that self-insert-command calls some undocumented hook to perform text completition. I am trying to ...
Hi-Angel's user avatar
  • 515
5 votes
1 answer
2k views

Is it possible to make flycheck-mode and company-mode play nice together?

I've encountered two very nice modes when it comes to developing C++ in Emacs. First we have flycheck-mode which on the fly checks the syntax of my code using various backends such as clang or gcc. ...
Rovanion's user avatar
  • 975
5 votes
1 answer
3k views

Add include paths to flycheck and to company-irony?

I am starting to develop a ROS (Robot Operating System) application for the first time using Emacs. Here is my ~/.emacs.d/init.el configuration for Flycheck and company packages: ;;;;;;;;;;;;;;;;;;;;;...
space_voyager's user avatar
5 votes
1 answer
2k views

Emacs - elisp code autocompletion in emacs-lisp-mode

With below setup, my ielm mode has autocompletion function: (require 'ac-slime) (add-hook 'slime-mode-hook 'set-up-slime-ac) (add-hook 'slime-repl-mode-hook 'set-up-slime-ac) (eval-after-load "auto-...
beetlej's user avatar
  • 1,056
4 votes
3 answers
314 views

Adding custom word list to company

Is it possible to add my personal custom list of words to the company database. Kindly guide me in a simple way. I am not a programmer.
Vaibhav's user avatar
  • 573
4 votes
1 answer
1k views

disable company-mode completion inside comments

This is something that's been bothering me for a while. I think I've configured company-mode backends wrong as I'm also getting company backends when inside comments. Here is my company-mode config ...
Chakravarthy Raghunandan's user avatar
4 votes
1 answer
5k views

spacemacs auto-complete layer: showing the difference between a snippet and a dictionary word

Say, I have been using Spacemacs for a while now, and was looking at Spacevim a bit. One nice feature of Spacevim is that it's autocompletion feature includes both the words for completion as well as ...
krishnab's user avatar
  • 519
4 votes
0 answers
1k views

How to use the auto-completion of jedi while keeping other functions of elpy?

Currently, I have both elpy and jedi installed. init.el is like: (elpy-enable) (elpy-use-ipython) (setq elpy-rpc-backend "jedi") (add-hook 'python-mode-hook 'jedi:setup) (setq jedi:complete-on-dot t)...
purplezzh's user avatar
3 votes
1 answer
9k views

How do I get company mode to recognize clang?

My current setup is as follows Elementary OS Freya Emacs version 24.5.1 company-mode 0.8.12 clang-3.5-dev libclang-3.5-dev I've checked that both libclang-3.5-dev and clang-3.5-dev are installed ...
greyowl's user avatar
  • 111
3 votes
2 answers
3k views

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

I use a function, ensure-packages-installed to "bootstrap" packages in my .emacs file. This ensures that if the package isn't already install. The follow is at the top of my .emacs: ; ; Set up Emacs ...
Steven Shaw's user avatar
3 votes
1 answer
242 views

Activate company in not all modes

Is it possible to define in which modes (programming languages) i want to have company activated? I want to have company in all my modes but not in lisp mode.
user avatar
3 votes
2 answers
1k views

No company mode found in packages list

I want to install the company mode, but searching in the M-x list-packages i find no company mode found, but a bunch of company backends for different languages. How should i install company? PS: ...
user avatar
3 votes
1 answer
2k views

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

Lately, I'm working on how to configure the best grouped company-backends for different major modes, although having been using company-mode for over one year (already got a configuration long time ...
CodyChan's user avatar
  • 2,589

1
2 3 4 5