-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-irony.el
64 lines (54 loc) · 1.9 KB
/
config-irony.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
;;; package --- Summary
;;; Commentary:
;;; Code:
(defvar company-idle-delay)
(defvar company-backends)
(defvar c-mode-map)
(defvar c++-mode-map)
(use-package irony
:ensure t
:config
(use-package company-irony
:ensure t
:config
(add-to-list 'company-backends 'company-irony))
(use-package company-irony-c-headers
:ensure t
:config
(add-to-list 'company-backends 'company-irony-c-headers))
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
;; replace the `completion-at-point' and `complete-symbol' bindings in
;; irony-mode's buffers by irony-mode's function
(defun my-irony-mode-hook ()
(define-key irony-mode-map [remap completion-at-point]
'irony-completion-at-point-async)
(define-key irony-mode-map [remap complete-symbol]
'irony-completion-at-point-async))
(add-hook 'irony-mode-hook 'my-irony-mode-hook)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
(add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)
(setq company-backends (delete 'company-semantic company-backends))
(eval-after-load 'company
'(add-to-list
'company-backends 'company-irony))
(use-package company
:ensure t
:init
(global-company-mode)
:bind (("<backtab>" . company-complete-common-or-cycle))
:config
(delete 'company-backends 'company-clang))
(use-package cmake-ide
:ensure t
:init
(use-package semantic/bovine/gcc)
;; (setq cmake-ide-flags-c++ (append '("-std=c++11")
;; (mapcar (lambda (path) (concat "-I" path)) (semantic-gcc-get-include-paths "c++"))))
;; (setq cmake-ide-flags-c (append (mapcar (lambda (path) (concat "-I" path)) (semantic-gcc-get-include-paths "c"))))
(cmake-ide-setup))
(setq company-idle-delay 0)
(define-key c-mode-map [(tab)] 'company-complete)
(define-key c++-mode-map [(tab)] 'company-complete)
;;; config-irony ends here