summaryrefslogtreecommitdiff
path: root/emacs.el
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2019-09-06 22:08:20 +0200
committerjohannst <johannes.stoelp@gmail.com>2019-09-06 22:08:20 +0200
commit95bc20fa96e9538cf771245ba798a8ef89e3b8d6 (patch)
treef263b7dcd18f274a4ba84c010fbf45db2b75fc21 /emacs.el
parentf5d2040987742006aec3684d0c2cc175c2b9c72f (diff)
downloaddotfiles-95bc20fa96e9538cf771245ba798a8ef89e3b8d6.tar.gz
dotfiles-95bc20fa96e9538cf771245ba798a8ef89e3b8d6.zip
emacs configure comapny mode + adding company c header
Diffstat (limited to 'emacs.el')
-rw-r--r--emacs.el19
1 files changed, 18 insertions, 1 deletions
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