From 95bc20fa96e9538cf771245ba798a8ef89e3b8d6 Mon Sep 17 00:00:00 2001 From: johannst Date: Fri, 6 Sep 2019 22:08:20 +0200 Subject: emacs configure comapny mode + adding company c header --- emacs.el | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index 41689ef..cf0c555 100644 --- a/emacs.el +++ b/emacs.el @@ -101,7 +101,24 @@ (use-package company :ensure t :config - (setq company-tooltip-align-annotations t) + (global-company-mode t) + (add-hook 'c++-mode-hook (lambda () (add-to-list 'company-dabbrev-code-modes 'c++-mode))) + (setq company-idle-delay 0 + company-minimum-prefix-length 1 + company-show-numbers t + company-dabbrev-downcase nil + company-tooltip-align-annotations t + ) + ) + +;; company-c-headers +(use-package company-c-headers + :ensure t + :requires (company) + :config + (add-to-list 'company-backends 'company-c-headers) + ;; simple heuristic to find latest c++ headers installed on system + (add-to-list 'company-c-headers-path-system (concat "/usr/include/c++/" (car (last (directory-files "/usr/include/c++" nil "^[1-9]"))))) ) ;; rust-mode -- cgit v1.2.3