Disclaimer: I'm the author of irony-mode
If you just want smart auto-completion, I can recommend irony-mode with company-irony.
irony-mode is easy to install thanks to MELPA
the completion is very accurate and the performance quite decent thanks to libclang
with company-irony you have an asynchronous completion backend that will not get in your way if the ...
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 matter to you:
Firstly, company-mode now targets Emacs 24, so if you're stuck with Emacs 23 then you're out of luck. auto-complete still works with Emacs 23.
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 summary of the differences.
I found company-mode to be easier to configure and to let it do what I want it to. With autocomplete-mode I ran into issues now and ...
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
(defvar company-mode/enable-yas t
"Enable yasnippet for all backends.")
(defun company-mode/backend-with-yas (backend)
(if (or (not company-mode/enable-yas) (...
Check my guide. It lists several methods for auto-completion in C/C++.
Those options are:
Using Irony. Highly recommended, since it uses Clang and easy to setup compared with other solutions.
Using the built-in parser from Emacs. It is the best auto-complete you can get is from within Emacs parser, Semantic, but it would be slow on large project like ...
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 in some cases.
E.g. if you open an Elisp buffer using Emacs-24.4 and the latest company-mode, if you type (wi-sy company will pop up a completion menu showing ...
The API completion at point function can be found in the documentation of completion-at-point-functions
Each function on this hook is called in turns without any argument and
should return either nil to mean that it is not applicable at point,
or a function of no argument to perform completion (discouraged), or a
list of the form (...
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-backend. This prompts you for the backend to use, then offers completion candidates.
Use company-other-backend to rotate through the list of backends (see next item)...
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 using the search box. It will list relevant options related to the package. You can also search for a variable with C-h v or search for a command with C-h a, ...
There is an adaptive sorting option for Helm which sorts the result according to their usage frequency. According to the helm source code it can be activated with the minor mode helm-adaptive-mode:
The Org Manual node on Motion gives a somewhat laconic description of the built-in command org-goto (default binding: C-c C-j), whose behaviour can easily be customised to achieve the desired effect:
Inspect the documentation of the customisable variable listed at the end of this manual node: C-h v org-goto-interface RET
If you are happy to forgo the ...
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 the downcase that company does to the variables I autocomplete, the second one I think you already have.
(defun tab-indent-or-complete ()
I think what you're looking for is C-M-j (ivy-immediate-done) in the mini buffer. This function is described as follows in the Ivy manual:
Exits with the current input instead of the current candidate (like
This is useful e.g. when you call find-file to create a new file, but
the desired name matches an existing file. In that ...
Call unload-feature to undefine all symbols that were defined as part of loading an Elisp source or byte-compiled file. Make sure that your file ends by calling provide at the end. This assumes that you loaded the file with one of the load functions or via require, it won't undefined symbols defined by C-M-x (eval-defun) or similar mechanisms.
If you really ...
A good answer would be quite long. The short answer is yes. Each of Helm and Icicles offers features not offered by the other.
They are not necessarily alternatives/competitors. You can use both.
Wrt your question about matching candidates, there is no difference wrt showing all candidates. IOW, Icicles too will show all candidates anytime you like (...
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 want to use Helm for completion, consider using helm-company or ac-helm. Haven't tried with ac-helm, but with helm-company, you can directly bind it to a key to ...
I've had great success with RTags + Company.
RTags needs a separate daemon rdm running that uses clang for code-completion, code-navigation and refactoring. rdm also functions as a database of symbols, meaning that autocompletion is much faster than any solution just directly calling clang_codeCompleteAt.
Rdm needs info of compilation flags for your ...
See libraries cus-edit.el and wid-edit.el (and their top-level libraries custom.el and widget.el, and associated component libraries), which are included with GNU Emacs. The former makes use of the latter. The latter defines basic (and not-so-basic) form-entry thingies, called "widgets", in a hierarchy. You can use these predefined widgets and functions in ...
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 the company-files in company-backends (M-x > customize-group > company > company backends)
As @wasamasa suggested, ido-ubiquitous should take care of completion when insert-char is used. There is a bug report that was closed in 2013, but I still see this behaviour with Emacs 24.4 and ido-ubiquitous version 20140904.1547, so I filed another bug report.
The maintainer of ido-ubiquitous wrote this:
Ok, I figured out the problem. There are ...
company-mode provides slightly better results than auto-complete using the bundled company-css backend.
You get completion of property names (up-to-date with the current state of CSS3, AFAIK), and some completion of property values, where they are simple, like a fixed set of options.
This can be solved by modifying company-transformers with the following code:
(push (apply-partially #'cl-remove-if
(or (string-match-p "[^\x00-\x7F]+" c)
(string-match-p "[0-9]+" c)
(if (equal major-mode "org")
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 there are multiple candidates. Tab is bound to company-complete-common, while return is bound to company-complete-selection. If you unbind the return key then ...
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 complete the current selection.
;;; - RET will only complete the current selection if the user has explicitly
;;; interacted with Company.
;;; - SPC will ...
What you want can be achieved by adding a new source to completion-at-point-functions. This isn't specific to ivy, but ivy makes use of it:
(defun dabbrev-complation-at-point ()
(let* ((abbrev (dabbrev--abbrev-at-point))
(candidates (dabbrev--find-all-expansions abbrev t))
I use the package worf, but I bind only one of its functions:
:bind (:map org-mode-map ("C-c h" . worf-goto)))
worf-goto gives you a list of the headings in the buffer in the mini buffer, which you can then filter.
The package is made by the author of ivy, so if you like ivy, you might like worf.
EDIT: As of late December 2018, this is no longer required, and lsp-mode does the required setup automatically. It was fixed in this commit as far as I can tell.
You need to call lsp-clients-register-clangd, as per https://github.com/emacs-lsp/lsp-clangd/issues/11. To do this, you can either call it interactively using M-x lsp-clients-register-clangd to ...
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 current command, sees if it satisfies the value of company-begin-commands, and calls company--perform.
The latter looks at the buffer contents, and checks whether ...
I added the following code to solve most of my problem:
(setq ac-source-yasnippet nil)
But, it caused complexity between yasnippet and auto-complete so I added this:
(define-key yas-minor-mode-map (kbd "<tab>") nil)
(define-key yas-minor-mode-map (kbd "TAB") nil)
(define-key yas-minor-mode-map (kbd "<backtab>") 'yas-expand)
Modified some ...