Skip to content

elp-revive/company-c-headers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: GPL v2 JCS-ELPA

company-c-headers

Auto-completion for C/C++ headers using Company

CI

This library enables the completion of C/C++ header file names using company-mode for Emacs.

When you type an #include declaration within a supported major mode (currently c-mode, c++-mode and objc-mode), company-c-headers will search for completion candidates within the defined include paths. There are “system” and “user” include paths, for #include <...> and #include "..." declarations, respectively.

During completion, the path to the current candidate can be seen in the minibuffer, such as in the screenshot above. Also during completion, you can use C-w to temporarily display the currently-selected header file.

This library is inspired by auto-complete-c-headers.

Installation

The best way to install this package is via MELPA.

Setup

With the company-c-headers library added to the load-path, all you need to do to initialize it is:

Alternatively, you can bind the company-c-headers-path-system and company-c-headers-path-user variables to functions which return the corresponding paths. For example, if you are using EDE, you can use the following:

(defun ede-object-system-include-path ()
  "Return the system include path for the current buffer."
  (when ede-object
    (ede-system-include-path ede-object)))

(setq company-c-headers-path-system 'ede-object-system-include-path)

About

Auto-completion for C/C++ headers using Company

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 97.7%
  • Makefile 2.3%